Updating dependencies for App testing.

This commit is contained in:
Roland 2023-01-07 18:53:22 -07:00
parent 6a5a73af22
commit 84802eaf66
No known key found for this signature in database
GPG key ID: 9D6DBD3ACF11AB93
5 changed files with 19 additions and 12 deletions

View file

@ -5,6 +5,17 @@ version: 2.1
# Define a job to be invoked later in a workflow.
# See: https://circleci.com/docs/2.0/configuration-reference/#jobs
jobs:
app-tests:
docker:
- image: cimg/node:14.20.0
steps:
- checkout
- run:
name: install dependencies
command: npm install
- run:
name: run tests
command: npm run test
api-tests-eight:
docker:
- image: cimg/python:3.8

View file

@ -4,8 +4,9 @@
"private": true,
"dependencies": {
"@artsy/fresnel": "^6.1.0",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"lodash": "^4.17.19",
"npm": "^6.14.7",
"query-string": "^6.13.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",

View file

@ -1,6 +1,7 @@
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
import React from "react";
import {render} from '@testing-library/react';
import '@testing-library/jest-dom';
import App from "./App";
Object.defineProperty(window, 'matchMedia', {
writable: true, value: jest.fn().mockImplementation(query => ({
@ -10,8 +11,6 @@ Object.defineProperty(window, 'matchMedia', {
})),
});
it('renders without crashing', () => {
const div = document.createElement('div');
ReactDOM.render(<App/>, div);
ReactDOM.unmountComponentAtNode(div);
test('renders without crashing', () => {
render(<App/>);
});

View file

@ -76,7 +76,6 @@ function ChannelStatistics({statistics}) {
function ChannelPage({create, header}) {
const [loading, setLoading] = useState(false);
const [disabled, setDisabled] = useState(false);
const [deleteOpen, setDeleteOpen] = useState(false);
const [validRegex, setValidRegex] = useState(true);
@ -147,7 +146,6 @@ function ChannelPage({create, header}) {
};
setDisabled(true);
setLoading(true);
let response = null;
try {
@ -167,7 +165,6 @@ function ChannelPage({create, header}) {
return;
} finally {
setDisabled(false);
setLoading(false);
}
if (response && response.status >= 200 && response.status < 300) {

View file

@ -114,7 +114,6 @@ export class Settings extends React.Component {
pending,
qrCodeValue,
throttle_on_startup,
timezone,
} = this.state;
const qrButton = <Button icon style={{marginBottom: '1em'}}><Icon name='qrcode' size='big'/></Button>;