Skip to content

Commit

Permalink
Remove jest-dom
Browse files Browse the repository at this point in the history
Remove dependency on jest-dom as it was no longer being used
apart from 2 instances of `toHaveTextContent` which were trivially
updated to use `getByText` instead.
  • Loading branch information
AlanGreene authored and tekton-robot committed Jun 10, 2020
1 parent 760dba4 commit 2f8fa5b
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 179 deletions.
1 change: 0 additions & 1 deletion config_frontend/setupTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ limitations under the License.
*/

import 'react-testing-library/cleanup-after-each';
import 'jest-dom/extend-expect';
import fetchMock from 'fetch-mock';

fetchMock.catch();
Expand Down
169 changes: 0 additions & 169 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@
"glob": "^7.1.4",
"html-webpack-plugin": "^3.2.0",
"jest": "^25.3.0",
"jest-dom": "^3.4.0",
"lerna": "^3.16.4",
"lodash.difference": "^4.5.0",
"lodash.omit": "^4.5.0",
Expand Down
11 changes: 3 additions & 8 deletions src/containers/TriggerTemplate/TriggerTemplate.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ it('TriggerTemplateContainer renders resource templates', async () => {
}
};

const { getByText, getByTestId } = renderWithRouter(
const { getByText } = renderWithRouter(
<TriggerTemplateContainer
intl={intl}
match={match}
Expand All @@ -282,13 +282,8 @@ it('TriggerTemplateContainer renders resource templates', async () => {
);

await waitForElement(() => getByText('pipeline-template'));

await waitForElement(() => getByText(resourceTemplate1NameInfo));
await waitForElement(() => getByText(resourceTemplate2NameInfo));

const resourceTemplatesTable = getByTestId('resourcetemplatestable');
expect(resourceTemplatesTable).toHaveTextContent(resourceTemplate1NameInfo);
expect(resourceTemplatesTable).toHaveTextContent(resourceTemplate2NameInfo);
expect(getByText(resourceTemplate1NameInfo)).toBeTruthy();
expect(getByText(resourceTemplate2NameInfo)).toBeTruthy();
});

it('TriggerTemplateContainer renders full resource template information', async () => {
Expand Down

0 comments on commit 2f8fa5b

Please sign in to comment.