This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #controls | |
| .menu first | |
| .menu second | |
| .menu third | |
| .menu fourth | |
| .menu fifth | |
| .menu sixth | |
| //- div(style="clear: both") | |
| #box | |
| .box |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //App.js: | |
| ... | |
| connect(mapStateToProps, { fetchData })(App) | |
| //ActionCreator: | |
| export const fetchData = () => (dispatch) => { | |
| dispatch({type: FETCHING_DATA}) | |
| getPeople() | |
| .then(data => dispatch({type: FETCHING_DATA_SUCCESS, payload: data})) | |
| .catch(er => dispatch({type: FETCHING_DATA_FAILURE})) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| a |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| describe('Log In', () => { | |
| it('succesfully performs login action', () => { | |
| // visit 'baseUrl' | |
| cy.visit('/'); | |
| // assert if we are in good place - search for a 'smarter world phrase | |
| cy.contains('smarter world'); | |
| // search for a div with 'Teachers' caption, and click it | |
| cy.get('a[data-testid="main-link-teachers"]').click(); | |
| // check if url have changed | |
| cy.url().should('includes', 'teachers'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| describe('Log In', () => { | |
| it('succesfully performs login action', () => { | |
| ... | |
| }); | |
| it('displays error message when login fails', () => { | |
| // go directly to login path | |
| cy.visit('/login'); | |
| // try to log in with incorect credentials | |
| cy.get('input[data-testid="login-form-username"]').type('test@email.com'); | |
| cy.get('input[data-testid="login-form-password"]').type('fail_password'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Cypress.Commands.add('login', (email, password) => { | |
| // Make a POST request to our backend | |
| // We are using GraphQL, so as a body we are passing mutation: | |
| cy | |
| .request({ | |
| url: 'http://localhost:4000/graphql', | |
| method: 'POST', | |
| body: { | |
| query: | |
| 'mutation login($email: String!, $password: String!) {loginUser(email: $email, password: $password)}', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const baseUrlMatcher = new RegExp('localhost:3000/$'); | |
| describe('Log out user properly', () => { | |
| // log in before each test: | |
| beforeEach(() => { | |
| cy.login('test@email.com', 'password'); | |
| }); | |
| it('can select dropdown and perform logout action', () => { | |
| // check if we are logged in: | |
| cy.url().should('contains', '/c/'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import * as React from 'react'; | |
| import { AppRegistry } from 'react-native'; | |
| import { ThemeProvider } from 'react-native-ios-kit'; | |
| import App from './src/App'; | |
| function Main() { | |
| return ( | |
| <ThemeProvider> | |
| <App /> | |
| </ThemeProvider> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* @flow */ | |
| import React, { Component } from 'react'; | |
| import { View, StyleSheet } from 'react-native'; | |
| import { withTheme, SearchBar } from 'react-native-ios-kit'; | |
| import type { Theme } from 'react-native-ios-kit/types'; | |
| type Props = { | |
| theme: Theme, | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import * as React from 'react'; | |
| import { AppRegistry } from 'react-native'; | |
| import { DefaultTheme, ThemeProvider } from 'react-native-ios-kit'; | |
| import color from 'color'; | |
| import App from './src/App'; | |
| const theme = { | |
| ...DefaultTheme, | |
| primaryColor: 'tomato', | |
| primaryLightColor: color('tomato').lighten(0.2).rgb().string(), |
OlderNewer