Skip to content

Commit ea1fa67

Browse files
committed
test: ✅ propagate browser test changes
1 parent 4fc845c commit ea1fa67

File tree

26 files changed

+988
-0
lines changed

26 files changed

+988
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import { render } from '@testing-library/angular';
2+
import { page } from 'vitest/browser';
3+
import { recipeMother } from '../testing/recipe.mother';
4+
import {
5+
provideRecipeRepositoryFake,
6+
RecipeRepositoryFake,
7+
} from './recipe-repository.fake';
8+
import { RecipeSearch } from './recipe-search.ng';
9+
10+
describe(RecipeSearch.name, () => {
11+
it('searches recipes without filtering', async () => {
12+
const { getRecipeNameEls } = await mountRecipeSearch();
13+
14+
await expect.element(getRecipeNameEls()).toHaveLength(2);
15+
await expect.element(getRecipeNameEls().nth(0)).toHaveTextContent('Burger');
16+
await expect.element(getRecipeNameEls().nth(1)).toHaveTextContent('Salad');
17+
});
18+
19+
async function mountRecipeSearch() {
20+
await render(RecipeSearch, {
21+
providers: [provideRecipeRepositoryFake()],
22+
configureTestBed(testBed) {
23+
testBed
24+
.inject(RecipeRepositoryFake)
25+
.setRecipes([
26+
recipeMother.withBasicInfo('Burger').build(),
27+
recipeMother.withBasicInfo('Salad').build(),
28+
]);
29+
},
30+
});
31+
32+
return {
33+
getRecipeNameEls() {
34+
return page.getByRole('heading');
35+
},
36+
};
37+
}
38+
});
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import { render } from '@testing-library/angular';
2+
import { page } from 'vitest/browser';
3+
import { recipeMother } from '../testing/recipe.mother';
4+
import {
5+
provideRecipeRepositoryFake,
6+
RecipeRepositoryFake,
7+
} from './recipe-repository.fake';
8+
import { RecipeSearch } from './recipe-search.ng';
9+
10+
describe(RecipeSearch.name, () => {
11+
it('searches recipes without filtering', async () => {
12+
const { getRecipeNameEls } = await mountRecipeSearch();
13+
14+
await expect.element(getRecipeNameEls()).toHaveLength(2);
15+
await expect.element(getRecipeNameEls().nth(0)).toHaveTextContent('Burger');
16+
await expect.element(getRecipeNameEls().nth(1)).toHaveTextContent('Salad');
17+
});
18+
19+
async function mountRecipeSearch() {
20+
await render(RecipeSearch, {
21+
providers: [provideRecipeRepositoryFake()],
22+
configureTestBed(testBed) {
23+
testBed
24+
.inject(RecipeRepositoryFake)
25+
.setRecipes([
26+
recipeMother.withBasicInfo('Burger').build(),
27+
recipeMother.withBasicInfo('Salad').build(),
28+
]);
29+
},
30+
});
31+
32+
return {
33+
getRecipeNameEls() {
34+
return page.getByRole('heading');
35+
},
36+
};
37+
}
38+
});
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import { render } from '@testing-library/angular';
2+
import { page } from 'vitest/browser';
3+
import { recipeMother } from '../testing/recipe.mother';
4+
import {
5+
provideRecipeRepositoryFake,
6+
RecipeRepositoryFake,
7+
} from './recipe-repository.fake';
8+
import { RecipeSearch } from './recipe-search.ng';
9+
10+
describe(RecipeSearch.name, () => {
11+
it('searches recipes without filtering', async () => {
12+
const { getRecipeNameEls } = await mountRecipeSearch();
13+
14+
await expect.element(getRecipeNameEls()).toHaveLength(2);
15+
await expect.element(getRecipeNameEls().nth(0)).toHaveTextContent('Burger');
16+
await expect.element(getRecipeNameEls().nth(1)).toHaveTextContent('Salad');
17+
});
18+
19+
async function mountRecipeSearch() {
20+
await render(RecipeSearch, {
21+
providers: [provideRecipeRepositoryFake()],
22+
configureTestBed(testBed) {
23+
testBed
24+
.inject(RecipeRepositoryFake)
25+
.setRecipes([
26+
recipeMother.withBasicInfo('Burger').build(),
27+
recipeMother.withBasicInfo('Salad').build(),
28+
]);
29+
},
30+
});
31+
32+
return {
33+
getRecipeNameEls() {
34+
return page.getByRole('heading');
35+
},
36+
};
37+
}
38+
});
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import { render } from '@testing-library/angular';
2+
import { page } from 'vitest/browser';
3+
import { recipeMother } from '../testing/recipe.mother';
4+
import {
5+
provideRecipeRepositoryFake,
6+
RecipeRepositoryFake,
7+
} from './recipe-repository.fake';
8+
import { RecipeSearch } from './recipe-search.ng';
9+
10+
describe(RecipeSearch.name, () => {
11+
it('searches recipes without filtering', async () => {
12+
const { getRecipeNameEls } = await mountRecipeSearch();
13+
14+
await expect.element(getRecipeNameEls()).toHaveLength(2);
15+
await expect.element(getRecipeNameEls().nth(0)).toHaveTextContent('Burger');
16+
await expect.element(getRecipeNameEls().nth(1)).toHaveTextContent('Salad');
17+
});
18+
19+
async function mountRecipeSearch() {
20+
await render(RecipeSearch, {
21+
providers: [provideRecipeRepositoryFake()],
22+
configureTestBed(testBed) {
23+
testBed
24+
.inject(RecipeRepositoryFake)
25+
.setRecipes([
26+
recipeMother.withBasicInfo('Burger').build(),
27+
recipeMother.withBasicInfo('Salad').build(),
28+
]);
29+
},
30+
});
31+
32+
return {
33+
getRecipeNameEls() {
34+
return page.getByRole('heading');
35+
},
36+
};
37+
}
38+
});
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import { render } from '@testing-library/angular';
2+
import { page } from 'vitest/browser';
3+
import { recipeMother } from '../testing/recipe.mother';
4+
import {
5+
provideRecipeRepositoryFake,
6+
RecipeRepositoryFake,
7+
} from './recipe-repository.fake';
8+
import { RecipeSearch } from './recipe-search.ng';
9+
10+
describe(RecipeSearch.name, () => {
11+
it('searches recipes without filtering', async () => {
12+
const { getRecipeNameEls } = await mountRecipeSearch();
13+
14+
await expect.element(getRecipeNameEls()).toHaveLength(2);
15+
await expect.element(getRecipeNameEls().nth(0)).toHaveTextContent('Burger');
16+
await expect.element(getRecipeNameEls().nth(1)).toHaveTextContent('Salad');
17+
});
18+
19+
async function mountRecipeSearch() {
20+
await render(RecipeSearch, {
21+
providers: [provideRecipeRepositoryFake()],
22+
configureTestBed(testBed) {
23+
testBed
24+
.inject(RecipeRepositoryFake)
25+
.setRecipes([
26+
recipeMother.withBasicInfo('Burger').build(),
27+
recipeMother.withBasicInfo('Salad').build(),
28+
]);
29+
},
30+
});
31+
32+
return {
33+
getRecipeNameEls() {
34+
return page.getByRole('heading');
35+
},
36+
};
37+
}
38+
});
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import { render } from '@testing-library/angular';
2+
import { page } from 'vitest/browser';
3+
import { recipeMother } from '../testing/recipe.mother';
4+
import {
5+
provideRecipeRepositoryFake,
6+
RecipeRepositoryFake,
7+
} from './recipe-repository.fake';
8+
import { RecipeSearch } from './recipe-search.ng';
9+
10+
describe(RecipeSearch.name, () => {
11+
it('searches recipes without filtering', async () => {
12+
const { getRecipeNameEls } = await mountRecipeSearch();
13+
14+
await expect.element(getRecipeNameEls()).toHaveLength(2);
15+
await expect.element(getRecipeNameEls().nth(0)).toHaveTextContent('Burger');
16+
await expect.element(getRecipeNameEls().nth(1)).toHaveTextContent('Salad');
17+
});
18+
19+
async function mountRecipeSearch() {
20+
await render(RecipeSearch, {
21+
providers: [provideRecipeRepositoryFake()],
22+
configureTestBed(testBed) {
23+
testBed
24+
.inject(RecipeRepositoryFake)
25+
.setRecipes([
26+
recipeMother.withBasicInfo('Burger').build(),
27+
recipeMother.withBasicInfo('Salad').build(),
28+
]);
29+
},
30+
});
31+
32+
return {
33+
getRecipeNameEls() {
34+
return page.getByRole('heading');
35+
},
36+
};
37+
}
38+
});
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import { render } from '@testing-library/angular';
2+
import { page } from 'vitest/browser';
3+
import { recipeMother } from '../testing/recipe.mother';
4+
import {
5+
provideRecipeRepositoryFake,
6+
RecipeRepositoryFake,
7+
} from './recipe-repository.fake';
8+
import { RecipeSearch } from './recipe-search.ng';
9+
10+
describe(RecipeSearch.name, () => {
11+
it('searches recipes without filtering', async () => {
12+
const { getRecipeNameEls } = await mountRecipeSearch();
13+
14+
await expect.element(getRecipeNameEls()).toHaveLength(2);
15+
await expect.element(getRecipeNameEls().nth(0)).toHaveTextContent('Burger');
16+
await expect.element(getRecipeNameEls().nth(1)).toHaveTextContent('Salad');
17+
});
18+
19+
async function mountRecipeSearch() {
20+
await render(RecipeSearch, {
21+
providers: [provideRecipeRepositoryFake()],
22+
configureTestBed(testBed) {
23+
testBed
24+
.inject(RecipeRepositoryFake)
25+
.setRecipes([
26+
recipeMother.withBasicInfo('Burger').build(),
27+
recipeMother.withBasicInfo('Salad').build(),
28+
]);
29+
},
30+
});
31+
32+
return {
33+
getRecipeNameEls() {
34+
return page.getByRole('heading');
35+
},
36+
};
37+
}
38+
});
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import { render } from '@testing-library/angular';
2+
import { page } from 'vitest/browser';
3+
import { recipeMother } from '../testing/recipe.mother';
4+
import {
5+
provideRecipeRepositoryFake,
6+
RecipeRepositoryFake,
7+
} from './recipe-repository.fake';
8+
import { RecipeSearch } from './recipe-search.ng';
9+
10+
describe(RecipeSearch.name, () => {
11+
it('searches recipes without filtering', async () => {
12+
const { getRecipeNameEls } = await mountRecipeSearch();
13+
14+
await expect.element(getRecipeNameEls()).toHaveLength(2);
15+
await expect.element(getRecipeNameEls().nth(0)).toHaveTextContent('Burger');
16+
await expect.element(getRecipeNameEls().nth(1)).toHaveTextContent('Salad');
17+
});
18+
19+
async function mountRecipeSearch() {
20+
await render(RecipeSearch, {
21+
providers: [provideRecipeRepositoryFake()],
22+
configureTestBed(testBed) {
23+
testBed
24+
.inject(RecipeRepositoryFake)
25+
.setRecipes([
26+
recipeMother.withBasicInfo('Burger').build(),
27+
recipeMother.withBasicInfo('Salad').build(),
28+
]);
29+
},
30+
});
31+
32+
return {
33+
getRecipeNameEls() {
34+
return page.getByRole('heading');
35+
},
36+
};
37+
}
38+
});
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import { render } from '@testing-library/angular';
2+
import { page } from 'vitest/browser';
3+
import { recipeMother } from '../testing/recipe.mother';
4+
import {
5+
provideRecipeRepositoryFake,
6+
RecipeRepositoryFake,
7+
} from './recipe-repository.fake';
8+
import { RecipeSearch } from './recipe-search.ng';
9+
10+
describe(RecipeSearch.name, () => {
11+
it('searches recipes without filtering', async () => {
12+
const { getRecipeNameEls } = await mountRecipeSearch();
13+
14+
await expect.element(getRecipeNameEls()).toHaveLength(2);
15+
await expect.element(getRecipeNameEls().nth(0)).toHaveTextContent('Burger');
16+
await expect.element(getRecipeNameEls().nth(1)).toHaveTextContent('Salad');
17+
});
18+
19+
async function mountRecipeSearch() {
20+
await render(RecipeSearch, {
21+
providers: [provideRecipeRepositoryFake()],
22+
configureTestBed(testBed) {
23+
testBed
24+
.inject(RecipeRepositoryFake)
25+
.setRecipes([
26+
recipeMother.withBasicInfo('Burger').build(),
27+
recipeMother.withBasicInfo('Salad').build(),
28+
]);
29+
},
30+
});
31+
32+
return {
33+
getRecipeNameEls() {
34+
return page.getByRole('heading');
35+
},
36+
};
37+
}
38+
});
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import { render } from '@testing-library/angular';
2+
import { page } from 'vitest/browser';
3+
import { recipeMother } from '../testing/recipe.mother';
4+
import {
5+
provideRecipeRepositoryFake,
6+
RecipeRepositoryFake,
7+
} from './recipe-repository.fake';
8+
import { RecipeSearch } from './recipe-search.ng';
9+
10+
describe(RecipeSearch.name, () => {
11+
it('searches recipes without filtering', async () => {
12+
const { getRecipeNameEls } = await mountRecipeSearch();
13+
14+
await expect.element(getRecipeNameEls()).toHaveLength(2);
15+
await expect.element(getRecipeNameEls().nth(0)).toHaveTextContent('Burger');
16+
await expect.element(getRecipeNameEls().nth(1)).toHaveTextContent('Salad');
17+
});
18+
19+
async function mountRecipeSearch() {
20+
await render(RecipeSearch, {
21+
providers: [provideRecipeRepositoryFake()],
22+
configureTestBed(testBed) {
23+
testBed
24+
.inject(RecipeRepositoryFake)
25+
.setRecipes([
26+
recipeMother.withBasicInfo('Burger').build(),
27+
recipeMother.withBasicInfo('Salad').build(),
28+
]);
29+
},
30+
});
31+
32+
return {
33+
getRecipeNameEls() {
34+
return page.getByRole('heading');
35+
},
36+
};
37+
}
38+
});

0 commit comments

Comments
 (0)