Permalink
Browse files

Start/stop meeting tests.

  • Loading branch information...
dblock committed Jun 30, 2018
1 parent f9c5350 commit b05d45de4f6d42f8b89148649c81bb6af37d7e9b
Showing with 274 additions and 33 deletions.
  1. +0 −9 App.test.js
  2. +9 −1 DEV.md
  3. +28 −0 __tests__/App-test.js
  4. +232 −0 __tests__/__snapshots__/App-test.js.snap
  5. +2 −2 package.json
  6. +3 −21 yarn.lock

This file was deleted.

Oops, something went wrong.
10 DEV.md
@@ -4,7 +4,7 @@

### node.js and npm

Install node.js and npm.
Install node.js, npm, yarn, then `yarn install`.

### create-react-native-app

@@ -17,10 +17,18 @@ create-react-native-app 33-minutes-app

### Expo

33-Minutes is an Expo app. Expo apps are React Native apps which contain the Expo SDK. See [expo.io](https://docs.expo.io/versions/v28.0.0/) for more information.

Create an account on [expo.io](https://expo.io), verify your email.

Download Expo XDE from https://github.com/expo/xde/releases.

Install `exp`.

```
npm install -g exp && exp path
```

## Working with Expo

### `npm start`
@@ -0,0 +1,28 @@
import React from 'react';
import App from '../App';

import renderer from 'react-test-renderer';

describe('app', () => {
const app = renderer.create(<App />);

it('renders app', () => {
const rendered = app.toJSON();
expect(rendered).toMatchSnapshot()
});

describe('toggle', () => {
it('start meeting', () => {
app.getInstance().toggleMeeting();
const rendered = app.toJSON();
expect(rendered).toMatchSnapshot()
});

it('stop meeting', () => {
app.getInstance().toggleMeeting();
const rendered = app.toJSON();
expect(rendered).toMatchSnapshot()
});
})
})

@@ -0,0 +1,232 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`app renders app 1`] = `
<View
style={
Object {
"alignItems": "center",
"backgroundColor": "#fff",
"flex": 1,
"justifyContent": "center",
}
}
>
<Text
accessible={true}
allowFontScaling={true}
ellipsizeMode="tail"
>
33 Minutes
</Text>
<View
accessibilityComponentType="button"
accessibilityLabel={undefined}
accessibilityTraits={
Array [
"button",
]
}
accessible={true}
collapsable={undefined}
hasTVPreferredFocus={undefined}
hitSlop={undefined}
isTVSelectable={true}
nativeID={undefined}
onLayout={undefined}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
onResponderTerminate={[Function]}
onResponderTerminationRequest={[Function]}
onStartShouldSetResponder={[Function]}
style={
Object {
"opacity": 1,
}
}
testID={undefined}
tvParallaxProperties={undefined}
>
<View
style={
Array [
Object {},
]
}
>
<Text
accessible={true}
allowFontScaling={true}
disabled={undefined}
ellipsizeMode="tail"
style={
Array [
Object {
"color": "#007AFF",
"fontSize": 18,
"padding": 8,
"textAlign": "center",
},
]
}
>
Start Meeting
</Text>
</View>
</View>
</View>
`;

exports[`app toggle start meeting 1`] = `
<View
style={
Object {
"alignItems": "center",
"backgroundColor": "#fff",
"flex": 1,
"justifyContent": "center",
}
}
>
<Text
accessible={true}
allowFontScaling={true}
ellipsizeMode="tail"
>
33 Minutes
</Text>
<View
accessibilityComponentType="button"
accessibilityLabel={undefined}
accessibilityTraits={
Array [
"button",
]
}
accessible={true}
collapsable={undefined}
hasTVPreferredFocus={undefined}
hitSlop={undefined}
isTVSelectable={true}
nativeID={undefined}
onLayout={undefined}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
onResponderTerminate={[Function]}
onResponderTerminationRequest={[Function]}
onStartShouldSetResponder={[Function]}
style={
Object {
"opacity": 1,
}
}
testID={undefined}
tvParallaxProperties={undefined}
>
<View
style={
Array [
Object {},
]
}
>
<Text
accessible={true}
allowFontScaling={true}
disabled={undefined}
ellipsizeMode="tail"
style={
Array [
Object {
"color": "#007AFF",
"fontSize": 18,
"padding": 8,
"textAlign": "center",
},
]
}
>
Stop Meeting
</Text>
</View>
</View>
</View>
`;

exports[`app toggle stop meeting 1`] = `
<View
style={
Object {
"alignItems": "center",
"backgroundColor": "#fff",
"flex": 1,
"justifyContent": "center",
}
}
>
<Text
accessible={true}
allowFontScaling={true}
ellipsizeMode="tail"
>
33 Minutes
</Text>
<View
accessibilityComponentType="button"
accessibilityLabel={undefined}
accessibilityTraits={
Array [
"button",
]
}
accessible={true}
collapsable={undefined}
hasTVPreferredFocus={undefined}
hitSlop={undefined}
isTVSelectable={true}
nativeID={undefined}
onLayout={undefined}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
onResponderTerminate={[Function]}
onResponderTerminationRequest={[Function]}
onStartShouldSetResponder={[Function]}
style={
Object {
"opacity": 1,
}
}
testID={undefined}
tvParallaxProperties={undefined}
>
<View
style={
Array [
Object {},
]
}
>
<Text
accessible={true}
allowFontScaling={true}
disabled={undefined}
ellipsizeMode="tail"
style={
Array [
Object {
"color": "#007AFF",
"fontSize": 18,
"padding": 8,
"textAlign": "center",
},
]
}
>
Start Meeting
</Text>
</View>
</View>
</View>
`;
@@ -5,7 +5,7 @@
"devDependencies": {
"react-native-scripts": "1.14.0",
"jest-expo": "~27.0.0",
"react-test-renderer": "16.3.1"
"react-test-renderer": "16.4.1"
},
"main": "./node_modules/react-native-scripts/build/bin/crna-entry.js",
"scripts": {
@@ -20,7 +20,7 @@
},
"dependencies": {
"expo": "^27.0.1",
"react": "16.3.1",
"react": "16.4.1",
"react-native": "~0.55.2"
}
}

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

0 comments on commit b05d45d

Please sign in to comment.