test: Update tests

A custom repo needs to be selected for the correct mocked response.
This commit is contained in:
regexowl 2024-07-11 15:55:07 +02:00 committed by Ondřej Ezr
parent c89b73687f
commit 989671ba95
2 changed files with 15 additions and 0 deletions

View file

@ -116,6 +116,16 @@ const checkRecommendationsEmptyState = async () => {
await screen.findByText('Select packages to generate recommendations.');
};
export const selectCustomRepo = async () => {
await clickBack();
const customRepoCheckbox = await screen.findByRole('checkbox', {
name: /select row 0/i,
});
await userEvent.click(customRepoCheckbox);
await clickNext();
};
describe('Step Packages', () => {
const setUp = async () => {
mockContentSourcesEnabled = false;
@ -225,6 +235,7 @@ describe('Step Packages', () => {
test('search results should be sorted with most relevant results first', async () => {
await setUp();
await selectCustomRepo();
await typeIntoSearchBox('test');
const packagesTable = await screen.findByTestId('packages-table');
@ -246,6 +257,7 @@ describe('Step Packages', () => {
test('selected packages are sorted the same way as available packages', async () => {
await setUp();
await selectCustomRepo();
await typeIntoSearchBox('test');
const checkboxes = await getAllCheckboxes();
@ -323,6 +335,7 @@ describe('Step Packages', () => {
test('should display relevant results in selected first', async () => {
await setUp();
await selectCustomRepo();
await typeIntoSearchBox('test');
const checkboxes = await getAllCheckboxes();

View file

@ -12,6 +12,7 @@ import {
packagesCreateBlueprintRequest,
} from '../../../../fixtures/editMode';
import { clickNext } from '../../../../testUtils';
import { selectCustomRepo } from '../../CreateImageWizard.content.test';
import {
blueprintRequest,
clickRegisterLater,
@ -281,6 +282,7 @@ describe('pagination on packages step', () => {
test('itemcount correct after search', async () => {
await renderCreateMode();
await goToPackagesStep();
await selectCustomRepo();
await searchForPackage();
await selectFirstPackage();
// the pagination in the top right