Skip to content

Commit 52a2ab5

Browse files
committed
test: ✅ tidy up
1 parent fe02896 commit 52a2ab5

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

apps/4-vitest-browser-starter/src/app/recipe/recipe-search.integration.spec.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,33 +10,32 @@ import { recipeMother } from './recipe.mother';
1010

1111
describe(RecipeSearch.name, () => {
1212
it('searches recipes without filtering', async () => {
13-
const { getRecipeNameEls } = await renderComponent();
13+
const { getRecipeNames } = await renderComponent();
1414

15-
const els = getRecipeNameEls();
15+
const els = getRecipeNames();
1616
expect.soft(els).toHaveLength(2);
1717
expect.soft(els[0]).toHaveTextContent('Burger');
1818
expect.soft(els[1]).toHaveTextContent('Salad');
1919
});
2020

2121
it('filters recipes by keywords', async () => {
22-
const { getRecipeNameEls, setKeywords } = await renderComponent();
22+
const { getRecipeNames, setKeywords } = await renderComponent();
2323

2424
await setKeywords('Burg');
2525

26-
const els = getRecipeNameEls();
26+
const els = getRecipeNames();
2727
expect.soft(els).toHaveLength(1);
2828
expect.soft(els[0]).toHaveTextContent('Burger');
2929
});
3030

3131
it('resets filters when clicking on the reset button', async () => {
32-
const { getRecipeNameEls, setKeywords, clickReset } =
33-
await renderComponent();
32+
const { getRecipeNames, setKeywords, clickReset } = await renderComponent();
3433

3534
await setKeywords('Burg');
3635

3736
await clickReset();
3837

39-
const els = getRecipeNameEls();
38+
const els = getRecipeNames();
4039
expect.soft(els).toHaveLength(2);
4140
expect.soft(els[0]).toHaveTextContent('Burger');
4241
expect.soft(els[1]).toHaveTextContent('Salad');
@@ -57,7 +56,7 @@ describe(RecipeSearch.name, () => {
5756
await fixture.whenStable();
5857

5958
return {
60-
getRecipeNameEls() {
59+
getRecipeNames() {
6160
return screen.queryAllByRole('heading');
6261
},
6362
async setKeywords(keywords: string) {

0 commit comments

Comments
 (0)