Skip to content

Commit 8550a58

Browse files
authored
Alpha (#1)
Alpha
2 parents e036346 + 3670fb5 commit 8550a58

38 files changed

+2282
-105
lines changed

.babelrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"presets":["@travi"],"ignore":["./lib/"]}
1+
{"presets":[["@travi", {"react": true}]],"ignore":["./lib/"]}

.eslintignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
/lib/
2-
/coverage/
2+
/coverage/
3+
/storybook-static/
4+
/cypress/

.eslintrc.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
extends:
22
- '@travi'
33
- '@travi/mocha'
4-
- '@travi/react'
4+
- '@travi/react'
5+
6+
overrides:
7+
- files: 'test/integration/*-spec.js'
8+
extends: '@travi/cypress'

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
/node_modules/
22
/lib/
33
/storybook-static/
4+
/cypress/videos/
5+
/cypress/fixtures/
46
/coverage/
57
/.nyc_output/
68

7-
.eslintcache
9+
.eslintcache

.nycrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"reporter":["lcov","text-summary","html"],"exclude":["src/**/*-test.js","test/","thirdparty-wrappers/","vendor/"]}
1+
{"reporter":["lcov","text-summary","html"],"exclude":["src/**/*-test.js","test/","thirdparty-wrappers/","vendor/","src/theme.js","**/styles.js"]}

.storybook/.babelrc

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{"presets": [
2+
["@travi", {"targets": {"browser": true}, "react": true, "modules": false}],
3+
"@emotion/babel-preset-css-prop"
4+
]}

.storybook/config.js

+16
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
11
import {configure} from '@storybook/react';
2+
import {useMediaQuery} from '@material-ui/core';
3+
import {MuiThemeProvider} from '@material-ui/core/styles';
4+
import {addDecorator} from '@storybook/react';
5+
import createTheme from '../src/theme';
6+
7+
const Wrapper = ({story}) => {
8+
const prefersDarkMode = useMediaQuery('(prefers-color-scheme: dark)');
9+
10+
return (
11+
<MuiThemeProvider theme={createTheme(prefersDarkMode ? 'dark' : 'light')}>
12+
{story()}
13+
</MuiThemeProvider>
14+
);
15+
};
16+
17+
addDecorator(story => <Wrapper story={story} />);
218

319
configure(require.context('../src', true, /stories\.js$/), module);

.storybook/preview-head.html

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Permanent+Marker:regular&text=Travi" />
2+
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500" />

cypress.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"integrationFolder": "test/integration",
3+
"baseUrl": "http://localhost:8888"
4+
}

cypress/plugins/index.js

+17
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+
}

cypress/support/commands.js

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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 will overwrite an existing command --
25+
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })
26+
27+
import '@testing-library/cypress/add-commands';

cypress/support/index.js

+20
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)