Skip to content

Commit 866003d

Browse files
committed
Fix redeclared vars and void assertions
1 parent 1dd66a7 commit 866003d

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

dotcom-rendering/src/components/FootballMatchHeader/FootballMatchHeader.stories.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,12 @@ export const Fixture = {
7171
},
7272
play: async ({ canvasElement }) => {
7373
const list = await getListElement(canvasElement);
74-
const items = within(list).getAllByRole('listitem');
74+
let items = within(list).getAllByRole('listitem');
7575
void expect(items.length).toBe(1);
7676
void expect(items[0]).toHaveTextContent('Match info');
7777

7878
await waitFor(() => {
79-
const items = within(list).getAllByRole('listitem');
79+
items = within(list).getAllByRole('listitem');
8080
void expect(items.length).toBe(1);
8181
void expect(items[0]).toHaveTextContent('Match info');
8282
});
@@ -127,12 +127,12 @@ export const Live = {
127127
},
128128
play: async ({ canvasElement }) => {
129129
const canvas = within(canvasElement);
130-
expect(canvas.getByLabelText('Score: 0')).toBeInTheDocument();
131-
expect(canvas.getByLabelText('Score: 13')).toBeInTheDocument();
130+
void expect(canvas.getByLabelText('Score: 0')).toBeInTheDocument();
131+
void expect(canvas.getByLabelText('Score: 13')).toBeInTheDocument();
132132

133133
await waitFor(() => {
134-
expect(canvas.getByLabelText('Score: 3')).toBeInTheDocument();
135-
expect(canvas.getByLabelText('Score: 4')).toBeInTheDocument();
134+
void expect(canvas.getByLabelText('Score: 3')).toBeInTheDocument();
135+
void expect(canvas.getByLabelText('Score: 4')).toBeInTheDocument();
136136
});
137137
},
138138
} satisfies Story;
@@ -162,12 +162,12 @@ export const Result = {
162162

163163
play: async ({ canvasElement }) => {
164164
const list = await getListElement(canvasElement);
165-
const items = within(list).getAllByRole('listitem');
165+
let items = within(list).getAllByRole('listitem');
166166
void expect(items.length).toBe(1);
167167
void expect(items[0]).toHaveTextContent('Match info');
168168

169169
await waitFor(() => {
170-
const items = within(list).getAllByRole('listitem');
170+
items = within(list).getAllByRole('listitem');
171171
void expect(items.length).toBe(3);
172172
void expect(items[0]).toHaveTextContent('Match report');
173173
void expect(items[1]).toHaveTextContent('Live feed');

0 commit comments

Comments
 (0)