Skip to content

Commit 3c8fcbb

Browse files
authored
v0.1.2 (#16)
* fix(commands): wording fixed in log of logout command ("user" instead of "use") * fix(examples): update deps of examples
1 parent 7c15cef commit 3c8fcbb

File tree

20 files changed

+12546
-21316
lines changed

20 files changed

+12546
-21316
lines changed

.travis.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,7 @@ notifications:
1212
on_failure: change
1313
on_success: change
1414

15-
cache:
16-
bundler: true
17-
directories:
18-
- $HOME/.npm
15+
cache: npm
1916

2017
branches:
2118
only:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ If you are intereted in what drove the need for this checkout [the why section](
5151
```js
5252
{
5353
"TEST_UID": "<- uid of the user you want to test as ->",
54-
"FIREBASE_PROJECT_ID": "<- projectId of your project ->"
54+
"FIREBASE_PROJECT_ID": "<- projectId of your project ->",
5555
}
5656
```
5757

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
module.exports = {
2+
extends: '../.eslintrc.js',
3+
env: {
4+
mocha: true,
5+
'cypress/globals': true
6+
},
7+
plugins: [
8+
'cypress',
9+
'chai-friendly'
10+
],
11+
rules: {
12+
'no-console': 0,
13+
'no-unused-expressions': 0,
14+
'chai-friendly/no-unused-expressions': 2
15+
}
16+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"name": "Using fixtures to represent data",
3+
"email": "[email protected]",
4+
"body": "Fixtures are a great way to mock data for responses to routes"
5+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
describe('Login', () => {
2+
beforeEach(() => {
3+
cy.visit('/login');
4+
});
5+
6+
it('Goes to login page', () => {
7+
cy.url().should('include', 'login');
8+
// cy.get('[data-test=sign-in]').click();
9+
// cy.get('[data-test=google-auth-button]').should('exist');
10+
});
11+
});
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
describe('Projects View', () => {
2+
3+
describe('when not authenticated', () => {
4+
it('Shows login message and button', () => {
5+
cy.get('[data-test=login]').click()
6+
});
7+
})
8+
9+
describe('when authenticated', () => {
10+
before(() => {
11+
// Go to home page
12+
cy.visit('/');
13+
// Login using custom token
14+
cy.login();
15+
// TODO: Use cy.setRtdb() to set projects created by authed user
16+
// cy.callRtdb('set', 'projects', listOfProjects)
17+
});
18+
19+
after(() => {
20+
// TODO: Use cy.setRtdb() to set projects created by authed user
21+
// cy.callRtdb('remove')
22+
})
23+
24+
it('Shows projects if logged in', () => {
25+
cy.get('[data-test=projects]').should('exist')
26+
});
27+
})
28+
29+
});
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// ***********************************************************
2+
// This example plugins/index.js can be used to load plugins
3+
//
4+
// You can change the location of this file or turn off loading
5+
// the plugins file with the 'pluginsFile' configuration option.
6+
//
7+
// You can read more here:
8+
// https://on.cypress.io/plugins-guide
9+
// ***********************************************************
10+
11+
// This function is called when a project is opened or re-opened (e.g. due to
12+
// the project's config changing)
13+
14+
module.exports = (on, config) => {
15+
// `on` is used to hook into various events Cypress emits
16+
// `config` is the resolved Cypress config
17+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// ***********************************************
2+
// This example commands.js shows you how to
3+
// create various custom commands and overwrite
4+
// existing commands.
5+
//
6+
// For more comprehensive examples of custom
7+
// commands please read more here:
8+
// https://on.cypress.io/custom-commands
9+
// ***********************************************
10+
//
11+
//
12+
// -- This is a parent command --
13+
// Cypress.Commands.add("login", (email, password) => { ... })
14+
//
15+
//
16+
// -- This is a child command --
17+
// Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... })
18+
//
19+
//
20+
// -- This is a dual command --
21+
// Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... })
22+
//
23+
//
24+
// -- This is will overwrite an existing command --
25+
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })
26+
import firebase from 'firebase/app';
27+
import 'firebase/auth';
28+
import 'firebase/database';
29+
import 'firebase/firestore';
30+
import { attachCustomCommands } from 'cypress-firebase';
31+
32+
const fbConfig = {
33+
apiKey: "AIzaSyCTUERDM-Pchn_UDTsfhVPiwM4TtNIxots",
34+
authDomain: "redux-firebasev3.firebaseapp.com",
35+
databaseURL: "https://redux-firebasev3.firebaseio.com",
36+
projectId: "redux-firebasev3",
37+
storageBucket: "redux-firebasev3.appspot.com",
38+
messagingSenderId: "823357791673"
39+
}
40+
41+
window.fbInstance = firebase.initializeApp(fbConfig);
42+
43+
attachCustomCommands({ Cypress, cy, firebase })
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// ***********************************************************
2+
// This example support/index.js is processed and
3+
// loaded automatically before your test files.
4+
//
5+
// This is a great place to put global configuration and
6+
// behavior that modifies Cypress.
7+
//
8+
// You can change the location of this file or turn off
9+
// automatically serving support files with the
10+
// 'supportFile' configuration option.
11+
//
12+
// You can read more here:
13+
// https://on.cypress.io/configuration
14+
// ***********************************************************
15+
16+
// Import commands.js using ES2015 syntax:
17+
import './commands'
18+
19+
// Alternatively you can use CommonJS syntax:
20+
// require('./commands')

0 commit comments

Comments
 (0)