Unverified Commit 63f66af5 authored by Andrey Azov's avatar Andrey Azov Committed by GitHub
Browse files

Update dependencies (#757)

- Typescript updated to version 4.7
- Faker now has to be imported via named import
- Fixed tests for TranscriptSequenceView (they were broken in multiple ways):
  - waitFor function wasn't getting awaited
  - mock transcripts were generated with randomly chosen forward or reverse strand,
    which introduced dangerous randomness in the tests
- Had some userEvent.click unnecessarily wrapped in an act; fixed that
parent c3ea3098
Pipeline #283318 passed with stages
in 5 minutes and 5 seconds
This diff is collapsed.
......@@ -34,16 +34,16 @@
"@loadable/component": "5.15.2",
"@loadable/server": "5.15.2",
"@react-spring/web": "9.4.5-beta.1",
"@reduxjs/toolkit": "1.8.1",
"@reduxjs/toolkit": "1.8.2",
"@sentry/browser": "6.19.7",
"classnames": "2.3.1",
"comlink": "4.3.1",
"core-js": "3.22.4",
"core-js": "3.22.7",
"cross-fetch": "3.1.5",
"d3": "6.7.0",
"express": "4.18.1",
"filesize": "8.0.7",
"graphql": "16.4.0",
"filesize": "9.0.0",
"graphql": "16.5.0",
"graphql-request": "4.2.0",
"http-proxy-middleware": "2.0.6",
"idb": "7.0.1",
......@@ -53,7 +53,7 @@
"react-cookie": "4.1.1",
"react-dom": "18.1.0",
"react-helmet-async": "1.3.0",
"react-redux": "8.0.1",
"react-redux": "8.0.2",
"react-router": "6.3.0",
"react-router-dom": "6.3.0",
"redux": "4.2.0",
......@@ -61,100 +61,100 @@
"redux-thunk": "2.4.1",
"rxjs": "7.5.5",
"typesafe-actions": "5.1.0",
"what-input": "5.2.11"
"what-input": "5.2.12"
},
"devDependencies": {
"@babel/core": "7.17.10",
"@babel/plugin-transform-modules-commonjs": "7.17.9",
"@babel/preset-env": "7.17.10",
"@babel/preset-react": "7.16.7",
"@babel/preset-typescript": "7.16.7",
"@faker-js/faker": "6.3.1",
"@babel/core": "7.18.2",
"@babel/plugin-transform-modules-commonjs": "7.18.2",
"@babel/preset-env": "7.18.2",
"@babel/preset-react": "7.17.12",
"@babel/preset-typescript": "7.17.12",
"@faker-js/faker": "7.1.0",
"@loadable/babel-plugin": "5.13.2",
"@loadable/webpack-plugin": "5.15.2",
"@storybook/addon-essentials": "6.5.0-beta.5",
"@storybook/addons": "6.5.0-beta.5",
"@storybook/builder-webpack5": "6.5.0-beta.5",
"@storybook/manager-webpack5": "6.5.0-beta.5",
"@storybook/react": "6.5.0-beta.5",
"@storybook/theming": "6.5.0-beta.5",
"@storybook/addon-essentials": "6.5.6",
"@storybook/addons": "6.5.6",
"@storybook/builder-webpack5": "6.5.6",
"@storybook/manager-webpack5": "6.5.6",
"@storybook/react": "6.5.6",
"@storybook/theming": "6.5.6",
"@svgr/webpack": "6.2.1",
"@testing-library/jest-dom": "5.16.4",
"@testing-library/react": "13.2.0",
"@testing-library/user-event": "14.1.1",
"@types/d3": "7.1.0",
"@testing-library/react": "13.3.0",
"@testing-library/user-event": "14.2.0",
"@types/d3": "7.4.0",
"@types/express": "4.17.13",
"@types/jest": "27.5.0",
"@types/jest": "27.5.1",
"@types/loadable__component": "5.13.4",
"@types/loadable__server": "5.12.6",
"@types/loadable__webpack-plugin": "5.7.3",
"@types/lodash": "4.14.182",
"@types/node": "17.0.31",
"@types/prettier": "2.6.0",
"@types/react": "18.0.8",
"@types/react-dom": "18.0.3",
"@types/node": "17.0.36",
"@types/prettier": "2.6.3",
"@types/react": "18.0.9",
"@types/react-dom": "18.0.5",
"@types/react-redux": "7.1.24",
"@types/react-router-dom": "5.3.3",
"@types/react-router-hash-link": "2.4.5",
"@types/redux-mock-store": "1.0.3",
"@types/webpack-env": "1.16.4",
"@types/webpack-env": "1.17.0",
"@types/webpack-hot-middleware": "2.25.6",
"@types/webpack-node-externals": "2.5.3",
"@types/workbox-webpack-plugin": "5.1.8",
"@typescript-eslint/eslint-plugin": "5.22.0",
"@typescript-eslint/parser": "5.22.0",
"@typescript-eslint/eslint-plugin": "5.26.0",
"@typescript-eslint/parser": "5.26.0",
"babel-core": "7.0.0-bridge.0",
"babel-jest": "28.0.3",
"babel-jest": "28.1.0",
"babel-loader": "8.2.5",
"babel-plugin-react-remove-properties": "0.3.0",
"compression-webpack-plugin": "9.2.0",
"copy-webpack-plugin": "10.2.4",
"compression-webpack-plugin": "10.0.0",
"copy-webpack-plugin": "11.0.0",
"css-loader": "6.7.1",
"css-minimizer-webpack-plugin": "3.4.1",
"eslint": "8.14.0",
"css-minimizer-webpack-plugin": "4.0.0",
"eslint": "8.16.0",
"eslint-config-prettier": "8.5.0",
"eslint-plugin-jest": "26.1.5",
"eslint-plugin-jest": "26.4.5",
"eslint-plugin-prettier": "4.0.0",
"eslint-plugin-react": "7.29.4",
"eslint-plugin-react": "7.30.0",
"eslint-plugin-react-hooks": "4.5.0",
"fork-ts-checker-webpack-plugin": "7.2.11",
"gh-pages": "3.2.3",
"gh-pages": "4.0.0",
"html-webpack-plugin": "5.5.0",
"husky": "7.0.4",
"husky": "8.0.1",
"identity-obj-proxy": "3.0.0",
"image-webpack-loader": "8.1.0",
"jest": "28.0.3",
"jest-environment-jsdom": "28.0.2",
"jest": "28.1.0",
"jest-environment-jsdom": "28.1.0",
"jest-fetch-mock": "3.0.3",
"jest-transform-stub": "2.0.0",
"licence-manager": "git+https://github.com/Ensembl/ensembl-licence-manager.git#36b534d28ff26d345b4ba4da0cbc18e1e0f7a6b7",
"lint-staged": "12.4.1",
"lint-staged": "12.4.3",
"mini-css-extract-plugin": "2.6.0",
"msw": "0.39.2",
"msw": "0.41.1",
"nodemon": "2.0.16",
"postcss": "8.4.13",
"postcss-loader": "6.2.1",
"postcss-preset-env": "7.5.0",
"postcss": "8.4.14",
"postcss-loader": "7.0.0",
"postcss-preset-env": "7.6.0",
"prettier": "2.6.2",
"redux-mock-store": "1.5.4",
"rimraf": "3.0.2",
"sass": "1.51.0",
"sass-loader": "12.6.0",
"sass": "1.52.1",
"sass-loader": "13.0.0",
"source-map-loader": "3.0.1",
"style-loader": "3.3.1",
"stylelint": "14.8.2",
"stylelint": "14.8.5",
"stylelint-config-recommended-scss": "6.0.0",
"stylelint-scss": "4.2.0",
"stylelint-webpack-plugin": "3.2.0",
"stylelint-webpack-plugin": "3.3.0",
"terser-webpack-plugin": "5.3.1",
"ts-multipick": "1.0.0",
"ts-node": "10.7.0",
"typescript": "4.6.4",
"webpack": "5.72.0",
"ts-node": "10.8.0",
"typescript": "4.7.2",
"webpack": "5.72.1",
"webpack-bundle-analyzer": "4.5.0",
"webpack-cli": "4.9.2",
"webpack-dev-middleware": "5.3.1",
"webpack-dev-server": "4.8.1",
"webpack-dev-middleware": "5.3.3",
"webpack-dev-server": "4.9.0",
"webpack-merge": "5.8.0",
"webpack-node-externals": "3.0.0",
"workbox-webpack-plugin": "6.5.3"
......
......@@ -17,7 +17,7 @@
import React from 'react';
import { render } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import faker from '@faker-js/faker';
import { faker } from '@faker-js/faker';
import times from 'lodash/times';
import CheckboxGrid, {
......
......@@ -17,7 +17,7 @@
import React from 'react';
import { render } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import faker from '@faker-js/faker';
import { faker } from '@faker-js/faker';
import times from 'lodash/times';
import CheckboxWithRadios, {
......
......@@ -17,7 +17,7 @@
import React from 'react';
import { render } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import faker from '@faker-js/faker';
import { faker } from '@faker-js/faker';
import times from 'lodash/times';
import CheckboxWithSelects, {
......
......@@ -17,7 +17,7 @@
import React from 'react';
import { render } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import faker from '@faker-js/faker';
import { faker } from '@faker-js/faker';
import CheckboxWithTextfields, {
CheckboxWithTextfieldsProps
......
......@@ -208,7 +208,7 @@ const ContentBuilder = (props: ContentBuilderProps) => {
label={entry.label}
isCollapsed={isCollapsed}
hideUnchecked={props.showOverview}
{...additionalProps}
{...(additionalProps as JSONValue)}
/>
</div>
);
......
......@@ -15,7 +15,7 @@
*/
import React from 'react';
import faker from '@faker-js/faker';
import { faker } from '@faker-js/faker';
import { render } from '@testing-library/react';
import { Provider } from 'react-redux';
import thunk from 'redux-thunk';
......
......@@ -15,7 +15,7 @@
*/
import React from 'react';
import faker from '@faker-js/faker';
import { faker } from '@faker-js/faker';
import { render } from '@testing-library/react';
import { TranscriptQualityLabel } from './TranscriptQualityLabel';
......
......@@ -14,7 +14,7 @@
* limitations under the License.
*/
import faker from '@faker-js/faker';
import { faker } from '@faker-js/faker';
import {
defaultSort,
......
......@@ -17,7 +17,7 @@
import React from 'react';
import { render } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import faker from '@faker-js/faker';
import { faker } from '@faker-js/faker';
import BrowserCog, { BrowserCogProps } from './BrowserCog';
......
......@@ -15,7 +15,7 @@
*/
import React from 'react';
import faker from '@faker-js/faker';
import { faker } from '@faker-js/faker';
import { render } from '@testing-library/react';
import { Provider } from 'react-redux';
import userEvent from '@testing-library/user-event';
......
......@@ -19,7 +19,7 @@ import { render, fireEvent, screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { Provider } from 'react-redux';
import thunk from 'redux-thunk';
import faker from '@faker-js/faker';
import { faker } from '@faker-js/faker';
import set from 'lodash/fp/set';
import { createMockBrowserState } from 'tests/fixtures/browser';
......
......@@ -20,7 +20,7 @@ import thunk from 'redux-thunk';
import configureMockStore from 'redux-mock-store';
import { render, screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import faker from '@faker-js/faker';
import { faker } from '@faker-js/faker';
import times from 'lodash/times';
import set from 'lodash/fp/set';
import merge from 'lodash/fp/merge';
......
......@@ -173,22 +173,18 @@ describe('<TranscriptSequenceView />', () => {
transcript: proteinCodingTranscript
});
waitFor(() => {
const sequenceContainer = container.querySelector(
'.sequence'
) as HTMLElement;
expect(sequenceContainer.textContent).toBe(mockGenomicSequence);
await waitFor(() => {
const sequenceContainer = container.querySelector('.sequence');
expect(sequenceContainer?.textContent).toBe(mockGenomicSequence);
});
const cdsSequenceLabel = getByLabelText('CDS');
await userEvent.click(cdsSequenceLabel);
waitFor(() => {
const sequenceContainer = container.querySelector(
'.sequence'
) as HTMLElement;
expect(sequenceContainer.textContent).toBe(mockCDSSequence);
await waitFor(() => {
const sequenceContainer = container.querySelector('.sequence');
expect(sequenceContainer?.textContent).toBe(mockCDSSequence);
});
});
});
......@@ -196,7 +192,9 @@ describe('<TranscriptSequenceView />', () => {
describe('reverse complement', () => {
it('only shows the reverse complement checkbox for the genomic sequence', async () => {
const { getByLabelText, queryByLabelText } = renderTranscriptSequenceView(
{ transcript: proteinCodingTranscript }
{
transcript: proteinCodingTranscript
}
);
const reverseComplementLabel = queryByLabelText('Reverse complement');
......@@ -208,7 +206,8 @@ describe('<TranscriptSequenceView />', () => {
for (const labelText of otherLabels) {
const label = getByLabelText(labelText);
await userEvent.click(label);
expect(queryByLabelText('Reverse complement')).toBe(null);
const reverseComplementLabel = queryByLabelText('Reverse complement');
expect(reverseComplementLabel).toBe(null);
}
});
......@@ -217,20 +216,16 @@ describe('<TranscriptSequenceView />', () => {
transcript: proteinCodingTranscript
});
waitFor(() => {
const sequenceContainer = container.querySelector(
'.sequence'
) as HTMLElement;
expect(sequenceContainer.textContent).toBe(mockGenomicSequence);
await waitFor(() => {
const sequenceContainer = container.querySelector('.sequence');
expect(sequenceContainer?.textContent).toBe(mockGenomicSequence);
});
await userEvent.click(getByLabelText('Reverse complement'));
waitFor(() => {
const sequenceContainer = container.querySelector(
'.sequence'
) as HTMLElement;
expect(sequenceContainer.textContent).toBe(
await waitFor(() => {
const sequenceContainer = container.querySelector('.sequence');
expect(sequenceContainer?.textContent).toBe(
getReverseComplement(mockGenomicSequence)
);
});
......
......@@ -19,7 +19,7 @@ import { Provider } from 'react-redux';
import { render } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import thunk from 'redux-thunk';
import faker from '@faker-js/faker';
import { faker } from '@faker-js/faker';
import configureMockStore from 'redux-mock-store';
import {
......
......@@ -14,7 +14,7 @@
* limitations under the License.
*/
import faker from '@faker-js/faker';
import { faker } from '@faker-js/faker';
import {
getChrLocationFromStr,
......
......@@ -20,7 +20,7 @@ import thunk from 'redux-thunk';
import { render } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import configureMockStore from 'redux-mock-store';
import faker from '@faker-js/faker';
import { faker } from '@faker-js/faker';
import times from 'lodash/times';
import merge from 'lodash/merge';
......
......@@ -18,7 +18,7 @@ import React from 'react';
import { setTimeout } from 'timers/promises';
import { render, fireEvent, createEvent, act } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import faker from '@faker-js/faker';
import { faker } from '@faker-js/faker';
import random from 'lodash/random';
import BlastInputSequence from './BlastInputSequence';
......
......@@ -14,7 +14,7 @@
* limitations under the License.
*/
import faker from '@faker-js/faker';
import { faker } from '@faker-js/faker';
import merge from 'lodash/merge';
import { initialState } from '../../state/blast-form/blastFormSlice';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment