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

Fix react testling library context errors #2903

Merged
merged 4 commits into from Nov 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -97,7 +97,7 @@
"@cypress/webpack-preprocessor": "^5.5.0",
"@manypkg/get-packages": "^1.1.3",
"@strictsoftware/typedoc-plugin-monorepo": "^0.3.1",
"@testing-library/jest-dom": "^5.4.0",
"@testing-library/jest-dom": "5.16.5",
"@types/aws-serverless-express": "^3.3.3",
"@types/codemirror": "^0.0.90",
"@types/express": "^4.17.11",
Expand Down
2 changes: 1 addition & 1 deletion packages/graphiql-react/package.json
Expand Up @@ -51,7 +51,7 @@
"set-value": "^4.1.0"
},
"devDependencies": {
"@testing-library/react": "9.4.1",
"@testing-library/react": "12.1.5",
"@types/codemirror": "^5.60.5",
"@types/set-value": "^4.0.1",
"@vitejs/plugin-react": "^1.3.0",
Expand Down
@@ -1,8 +1,4 @@
import {
// @ts-expect-error
fireEvent,
render,
} from '@testing-library/react';
import { fireEvent, render } from '@testing-library/react';
import { GraphQLString, GraphQLObjectType, Kind } from 'graphql';

import { ExplorerContext, ExplorerFieldDef } from '../../context';
Expand Down
@@ -1,8 +1,4 @@
import {
// @ts-expect-error
fireEvent,
render,
} from '@testing-library/react';
import { fireEvent, render } from '@testing-library/react';
import {
GraphQLBoolean,
GraphQLEnumType,
Expand Down Expand Up @@ -89,7 +85,7 @@ describe('TypeDocumentation', () => {
const title = container.querySelector(
'.graphiql-doc-explorer-section-title',
);
title.removeChild(title.childNodes[0]);
title?.removeChild(title?.childNodes[0]);
expect(title).toHaveTextContent('Possible Types');
});

Expand All @@ -100,7 +96,7 @@ describe('TypeDocumentation', () => {
const title = container.querySelector(
'.graphiql-doc-explorer-section-title',
);
title.removeChild(title.childNodes[0]);
title?.removeChild(title?.childNodes[0]);
expect(title).toHaveTextContent('Enum Values');
const enums = container.querySelectorAll(
'.graphiql-doc-explorer-enum-value',
Expand All @@ -119,7 +115,7 @@ describe('TypeDocumentation', () => {
const title = container.querySelector(
'.graphiql-doc-explorer-section-title',
);
title.removeChild(title.childNodes[0]);
title?.removeChild(title?.childNodes[0]);
expect(title).toHaveTextContent('Enum Values');

let enums = container.querySelectorAll('.graphiql-doc-explorer-enum-value');
Expand Down
@@ -1,8 +1,4 @@
import {
// @ts-expect-error
fireEvent,
render,
} from '@testing-library/react';
import { fireEvent, render } from '@testing-library/react';
import { GraphQLNonNull, GraphQLList, GraphQLString } from 'graphql';
import { ComponentProps } from 'react';

Expand Down
@@ -1,8 +1,4 @@
import {
// @ts-expect-error
fireEvent,
render,
} from '@testing-library/react';
import { fireEvent, render } from '@testing-library/react';
import { ComponentProps } from 'react';
import { formatQuery, HistoryItem } from '../components';
import { HistoryContextProvider } from '../context';
Expand Down
6 changes: 3 additions & 3 deletions packages/graphiql/package.json
Expand Up @@ -62,12 +62,12 @@
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
},
"devDependencies": {
"@testing-library/jest-dom": "^5.4.0",
"@testing-library/react": "9.4.1",
"@testing-library/jest-dom": "5.16.5",
"@testing-library/react": "12.1.5",
"@types/codemirror": "^5.60.5",
"@types/markdown-it": "^12.2.3",
"@types/node": "^14.14.22",
"@types/testing-library__jest-dom": "^5.0.1",
"@types/testing-library__jest-dom": "5.14.5",
"babel-loader": "^8.1.0",
"babel-plugin-macros": "^2.8.0",
"cross-env": "^7.0.2",
Expand Down