Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

started simple smoke test #55

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ node_js:
script:
- npm run format
- npm run lint
- npm run test
notifications:
email: false
3 changes: 3 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
...require('@snowpack/app-scripts-preact/jest.config.js')(),
};
306 changes: 230 additions & 76 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
},
"devDependencies": {
"@babel/preset-react": "^7.12.1",
"@snowpack/app-scripts-react": "^1.12.4",
"@snowpack/app-scripts-react": "^1.12.6",
"@snowpack/plugin-dotenv": "^2.0.4",
"@snowpack/plugin-react-refresh": "^2.3.4",
"@snowpack/web-test-runner-plugin": "^0.1.3",
Expand Down
2 changes: 1 addition & 1 deletion src/components/Canvas.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState, useEffect } from 'react';
import React, { useEffect } from 'react';
import ReactFlow, {
removeElements,
addEdge,
Expand Down
11 changes: 11 additions & 0 deletions src/test/AddPathBtn.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from 'react';
import ReactDOM from 'react-dom';
import AddPathBtn from '../components/editor/AddPathBtn';

describe('<AddPathBtn />', () => {
it('renders without crashing', () => {
const div = document.createElement('div');
ReactDOM.render(<AddPathBtn />, div);
ReactDOM.unmountComponentAtNode(div);
});
});
20 changes: 20 additions & 0 deletions src/test/App.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// make React available
import React from 'react';

// make the ReactDOM available, necessary for rendering the component
import ReactDOM from 'react-dom';

// make the App component available
import App from '../App';

// this is the test case
it('renders without crashing', () => {
// first create a DOM element to render the component into
const div = document.createElement('div');

// render the component, this is the actual test, if something is wrong it will fail here
ReactDOM.render(<App />, div);

// clean up code
ReactDOM.unmountComponentAtNode(div);
});
12 changes: 12 additions & 0 deletions src/test/Description.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { expect } from 'chai';
import React from 'react';
import ReactDOM from 'react-dom';
import Description from '../components/editor/Description';

describe('<Description />', () => {
it('renders without crashing', () => {
const div = document.createElement('div');
ReactDOM.render(<Description />, div);
ReactDOM.unmountComponentAtNode(div);
});
});
12 changes: 12 additions & 0 deletions src/test/Layout.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import React from 'react';
import ReactDOM from 'react-dom';
import { ElementsProvider } from '../hooks/useElements';
import Layout from '../Layout';

describe('<Layout />', () => {
it('renders without crashing', () => {
const div = document.createElement('div');
ReactDOM.render(<ElementsProvider><Layout /></ElementsProvider>, div);
ReactDOM.unmountComponentAtNode(div);
});
});
11 changes: 11 additions & 0 deletions src/test/MethodSelect.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from 'react';
import ReactDOM from 'react-dom';
import MethodSelect from '../components/editor/MethodSelect';

describe('<MethodSelect />', () => {
it('renders without crashing', () => {
const div = document.createElement('div');
ReactDOM.render(<MethodSelect />, div);
ReactDOM.unmountComponentAtNode(div);
});
});
11 changes: 11 additions & 0 deletions src/test/Path.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from 'react';
import ReactDOM from 'react-dom';
import Path from '../components/editor/Path';

describe('<Path />', () => {
it('renders without crashing', () => {
const div = document.createElement('div');
ReactDOM.render(<Path />, div);
ReactDOM.unmountComponentAtNode(div);
});
});