Skip to content

Commit 2a27a40

Browse files
combine python percy tests and storybook tests (#53)
1 parent 7fe47cd commit 2a27a40

File tree

9 files changed

+583
-788
lines changed

9 files changed

+583
-788
lines changed

packages/dash-table/.circleci/config.yml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ jobs:
3333
name: Install requirements
3434
command: |
3535
. venv/bin/activate
36-
pip install -r tests/python_fixtures/requirements.txt --quiet
36+
pip install -r .circleci/python-requirements.txt --quiet
3737
3838
- save_cache:
39-
key: deps1-{{ .Branch }}-{{ checksum "tests/python_fixtures/requirements.txt" }}
39+
key: deps1-{{ .Branch }}-{{ checksum ".circleci/python-requirements.txt" }}
4040
paths:
4141
- "venv"
4242

@@ -101,10 +101,10 @@ jobs:
101101
name: Install requirements
102102
command: |
103103
. venv/bin/activate
104-
pip install -r tests/python_fixtures/requirements.txt --quiet
104+
pip install -r .circleci/python-requirements.txt --quiet
105105
106106
- save_cache:
107-
key: deps1-{{ .Branch }}-{{ checksum "tests/python_fixtures/requirements.txt" }}
107+
key: deps1-{{ .Branch }}-{{ checksum ".circleci/python-requirements.txt" }}
108108
paths:
109109
- "venv"
110110

@@ -122,13 +122,6 @@ jobs:
122122
flake8 usage.py tests
123123
when: always
124124

125-
- run:
126-
name: Integration Tests
127-
command: |
128-
. venv/bin/activate
129-
python -m unittest tests.python_fixtures.test_render
130-
when: always
131-
132125

133126
workflows:
134127
version: 2

packages/dash-table/tests/python_fixtures/requirements.txt renamed to packages/dash-table/.circleci/python-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ pandas
1111
percy
1212
selenium
1313
flake8
14-
pylint
14+
pylint

packages/dash-table/demo/App.js

Lines changed: 6 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ import React, {Component} from 'react';
33
import PropTypes from 'prop-types';
44
import {Table} from 'dash-table';
55
import {mockData} from './data';
6-
import Dropdown from 'react-select';
7-
import TestFixtures from 'tests/python_fixtures/fixtures.json';
86
import {merge} from 'ramda';
97
import { memoizeOne } from 'core/memoizer';
108

@@ -14,8 +12,6 @@ class App extends Component {
1412
constructor() {
1513
super();
1614

17-
this.onChange = this.onChange.bind(this);
18-
1915
this.state = {
2016
filter: '',
2117
tableProps: {
@@ -43,17 +39,9 @@ class App extends Component {
4339
}))
4440
}
4541
],
46-
},
47-
selectedFixture: null,
42+
}
4843
};
4944

50-
const getOptions = memoizeOne(fixtures => {
51-
return fixtures.map(t => ({
52-
label: t.name,
53-
value: JSON.stringify(t.props),
54-
}));
55-
});
56-
5745
const setProps = memoizeOne(() => {
5846
return newProps => {
5947
console.info('--->', newProps);
@@ -63,53 +51,17 @@ class App extends Component {
6351
};
6452
});
6553

66-
Object.defineProperty(this, 'options', {
67-
get: () => getOptions(TestFixtures)
68-
});
69-
7054
Object.defineProperty(this, 'setProps', {
7155
get: () => setProps()
7256
});
7357
}
7458

75-
onChange(e) {
76-
this.setState({
77-
tableProps: JSON.parse(e.value),
78-
selectedFixture: e.value,
79-
})
80-
}
81-
8259
render() {
83-
return (
84-
<div>
85-
{<div>
86-
<label>Load test case</label>
87-
<Dropdown
88-
options={this.options}
89-
onChange={this.onChange}
90-
value={this.state.selectedFixture}
91-
/>
92-
</div>}
93-
94-
<hr />
95-
<label>test events:{'\u00A0\u00A0'}</label>
96-
<input type="text" />
97-
<input type="text" />
98-
<input type="text" />
99-
<hr />
100-
101-
<input
102-
type='text'
103-
value={this.state.filter}
104-
onChange={e => this.setState({ filter: e.target.value })}
105-
/>
106-
<Table
107-
setProps={this.setProps}
108-
{...this.state.tableProps}
109-
{...{ filtering: 'fe', filtering_settings: this.state.filter }}
110-
/>
111-
</div>
112-
);
60+
return (<Table
61+
setProps={this.setProps}
62+
{...this.state.tableProps}
63+
{...{ filtering: 'fe', filtering_settings: this.state.filter }}
64+
/>);
11365
}
11466
}
11567

packages/dash-table/tests/python_fixtures/IntegrationTests.py

Lines changed: 0 additions & 109 deletions
This file was deleted.

packages/dash-table/tests/python_fixtures/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)