some more progress toward ubiquitous eslint-plugin-testing-library

Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
Fredrik Adelöw
2022-11-21 13:05:30 +01:00
parent b0b2a5ddb0
commit 3bd6cc7c55
41 changed files with 390 additions and 393 deletions
@@ -76,7 +76,7 @@ describe('AuditListTable', () => {
if (!website)
throw new Error('https://anchor.fm must be present in fixture');
expect(
rendered.queryByText(formatTime(website.lastAudit.timeCreated)),
rendered.getByText(formatTime(website.lastAudit.timeCreated)),
).toBeInTheDocument();
});
@@ -98,7 +98,7 @@ describe('AuditView', () => {
websiteResponse.audits.forEach(a => {
expect(
rendered.queryByText(formatTime(a.timeCreated)),
rendered.getByText(formatTime(a.timeCreated)),
).toBeInTheDocument();
});
});
@@ -199,7 +199,7 @@ describe('AuditView', () => {
await rendered.findByTestId('audit-sidebar');
expect(rendered.queryByTestId('progress')).toBeInTheDocument();
expect(rendered.getByTestId('progress')).toBeInTheDocument();
});
});
@@ -219,7 +219,7 @@ describe('AuditView', () => {
await rendered.findByTestId('audit-sidebar');
expect(rendered.queryByText(/This audit failed/)).toBeInTheDocument();
expect(rendered.getByText(/This audit failed/)).toBeInTheDocument();
});
});
});
@@ -25,7 +25,7 @@ describe('LighthouseIntro', () => {
it('renders successfully', () => {
const rendered = render(wrapInTestApp(<LighthouseIntro />));
expect(
rendered.queryByText('Welcome to Lighthouse in Backstage!'),
rendered.getByText('Welcome to Lighthouse in Backstage!'),
).toBeInTheDocument();
});
@@ -35,7 +35,7 @@ describe('LighthouseIntro', () => {
it('selects the first text element', () => {
const rendered = render(wrapInTestApp(<LighthouseIntro />));
expect(rendered.queryByText(firstTabRe)).toBeInTheDocument();
expect(rendered.getByText(firstTabRe)).toBeInTheDocument();
expect(rendered.queryByText(secondTabRe)).not.toBeInTheDocument();
});
@@ -43,7 +43,7 @@ describe('LighthouseIntro', () => {
const rendered = render(wrapInTestApp(<LighthouseIntro />));
fireEvent.click(rendered.getByText('Setup'));
expect(rendered.queryByText(firstTabRe)).not.toBeInTheDocument();
expect(rendered.queryByText(secondTabRe)).toBeInTheDocument();
expect(rendered.getByText(secondTabRe)).toBeInTheDocument();
});
});