test: Update tests
A custom repo needs to be selected for the correct mocked response.
This commit is contained in:
parent
c89b73687f
commit
989671ba95
2 changed files with 15 additions and 0 deletions
|
|
@ -116,6 +116,16 @@ const checkRecommendationsEmptyState = async () => {
|
||||||
await screen.findByText('Select packages to generate recommendations.');
|
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', () => {
|
describe('Step Packages', () => {
|
||||||
const setUp = async () => {
|
const setUp = async () => {
|
||||||
mockContentSourcesEnabled = false;
|
mockContentSourcesEnabled = false;
|
||||||
|
|
@ -225,6 +235,7 @@ describe('Step Packages', () => {
|
||||||
test('search results should be sorted with most relevant results first', async () => {
|
test('search results should be sorted with most relevant results first', async () => {
|
||||||
await setUp();
|
await setUp();
|
||||||
|
|
||||||
|
await selectCustomRepo();
|
||||||
await typeIntoSearchBox('test');
|
await typeIntoSearchBox('test');
|
||||||
|
|
||||||
const packagesTable = await screen.findByTestId('packages-table');
|
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 () => {
|
test('selected packages are sorted the same way as available packages', async () => {
|
||||||
await setUp();
|
await setUp();
|
||||||
|
|
||||||
|
await selectCustomRepo();
|
||||||
await typeIntoSearchBox('test');
|
await typeIntoSearchBox('test');
|
||||||
|
|
||||||
const checkboxes = await getAllCheckboxes();
|
const checkboxes = await getAllCheckboxes();
|
||||||
|
|
@ -323,6 +335,7 @@ describe('Step Packages', () => {
|
||||||
test('should display relevant results in selected first', async () => {
|
test('should display relevant results in selected first', async () => {
|
||||||
await setUp();
|
await setUp();
|
||||||
|
|
||||||
|
await selectCustomRepo();
|
||||||
await typeIntoSearchBox('test');
|
await typeIntoSearchBox('test');
|
||||||
|
|
||||||
const checkboxes = await getAllCheckboxes();
|
const checkboxes = await getAllCheckboxes();
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ import {
|
||||||
packagesCreateBlueprintRequest,
|
packagesCreateBlueprintRequest,
|
||||||
} from '../../../../fixtures/editMode';
|
} from '../../../../fixtures/editMode';
|
||||||
import { clickNext } from '../../../../testUtils';
|
import { clickNext } from '../../../../testUtils';
|
||||||
|
import { selectCustomRepo } from '../../CreateImageWizard.content.test';
|
||||||
import {
|
import {
|
||||||
blueprintRequest,
|
blueprintRequest,
|
||||||
clickRegisterLater,
|
clickRegisterLater,
|
||||||
|
|
@ -281,6 +282,7 @@ describe('pagination on packages step', () => {
|
||||||
test('itemcount correct after search', async () => {
|
test('itemcount correct after search', async () => {
|
||||||
await renderCreateMode();
|
await renderCreateMode();
|
||||||
await goToPackagesStep();
|
await goToPackagesStep();
|
||||||
|
await selectCustomRepo();
|
||||||
await searchForPackage();
|
await searchForPackage();
|
||||||
await selectFirstPackage();
|
await selectFirstPackage();
|
||||||
// the pagination in the top right
|
// the pagination in the top right
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue