Skip to content

Commit fdf032f

Browse files
committed
Remove testing-library__dom
1 parent 119e086 commit fdf032f

File tree

4 files changed

+11
-26
lines changed

4 files changed

+11
-26
lines changed

jest.config.ts

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ const ES_MODULE_DEPENDENCIES = [
1212
'firebase',
1313
'lit',
1414
'pwa-helpers',
15-
'testing-library__dom',
1615
].join('|');
1716

1817
const config: InitialOptionsTsJest = {

package-lock.json

-13
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@
112112
"stylelint": "^14.14.0",
113113
"stylelint-config-prettier": "^9.0.3",
114114
"stylelint-config-standard": "^29.0.0",
115-
"testing-library__dom": "^7.29.4-beta.1",
116115
"ts-jest": "^29.0.3",
117116
"ts-node": "^10.9.1",
118117
"typescript": "^4.8.4"

src/components/about-block.test.ts

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import { beforeEach, describe, it, jest } from '@jest/globals';
2-
import { within } from '@testing-library/dom';
2+
import { fireEvent, screen, within } from '@testing-library/dom';
33
import { mocked } from 'jest-mock';
44
import { html } from 'lit';
5-
// TODO: Switch back to standard @testing-library/dom https://github.com/testing-library/dom-testing-library/issues/413
6-
import { fireEvent, screen } from 'testing-library__dom';
75
import { fixture } from '../../__tests__/helpers/fixtures';
86
import { openVideoDialog } from '../store/ui/actions';
97
import { aboutBlock } from '../utils/data';
@@ -23,14 +21,16 @@ describe('about-block', () => {
2321
});
2422

2523
it('renders details', async () => {
26-
await fixture(html`<about-block></about-block>`);
27-
28-
expect(screen.getByText(aboutBlock.title)).toBeInTheDocument();
29-
expect(
30-
screen.getByText(aboutBlock.callToAction.featuredSessions.description)
31-
).toBeInTheDocument();
32-
expect(screen.getByText(aboutBlock.statisticsBlock.attendees.number)).toBeInTheDocument();
33-
expect(screen.getByText(aboutBlock.statisticsBlock.attendees.label)).toBeInTheDocument();
24+
const { shadowRootForWithin } = await fixture(
25+
html`<about-block data-testid="block"></about-block>`
26+
);
27+
const { getByText } = within(shadowRootForWithin);
28+
29+
expect(screen.getByTestId('block')).toBeInTheDocument();
30+
expect(getByText(aboutBlock.title)).toBeInTheDocument();
31+
expect(getByText(aboutBlock.callToAction.featuredSessions.description)).toBeInTheDocument();
32+
expect(getByText(aboutBlock.statisticsBlock.attendees.number)).toBeInTheDocument();
33+
expect(getByText(aboutBlock.statisticsBlock.attendees.label)).toBeInTheDocument();
3434
});
3535

3636
it('plays the video', async () => {

0 commit comments

Comments
 (0)