Wizard: Add tests for repositories and snapshot steps
Tests the bulk select and verifies disabled repositories.
This commit is contained in:
parent
90f7ce111a
commit
eab407c09e
3 changed files with 107 additions and 0 deletions
|
|
@ -88,6 +88,14 @@ const deselectFirstRepository = async () => {
|
|||
await waitFor(async () => user.click(row0Checkbox));
|
||||
};
|
||||
|
||||
const clickBulkSelect = async () => {
|
||||
const user = userEvent.setup();
|
||||
const bulkSelectCheckbox = await screen.findByRole('checkbox', {
|
||||
name: /select all/i,
|
||||
});
|
||||
await waitFor(async () => user.click(bulkSelectCheckbox));
|
||||
};
|
||||
|
||||
describe('repositories request generated correctly', () => {
|
||||
beforeEach(() => {
|
||||
vi.clearAllMocks();
|
||||
|
|
@ -178,6 +186,18 @@ describe('repositories request generated correctly', () => {
|
|||
expect(receivedRequest).toEqual(expectedRequest);
|
||||
});
|
||||
});
|
||||
|
||||
test('bulk select', async () => {
|
||||
await renderCreateMode();
|
||||
await goToRepositoriesStep();
|
||||
await clickBulkSelect();
|
||||
await goToReviewStep();
|
||||
const receivedRequest = (await interceptBlueprintRequest(
|
||||
CREATE_BLUEPRINT
|
||||
)) as CreateBlueprintRequest;
|
||||
expect(receivedRequest.customizations.custom_repositories).toHaveLength(6);
|
||||
expect(receivedRequest.customizations.payload_repositories).toHaveLength(6);
|
||||
});
|
||||
});
|
||||
|
||||
describe('Repositories edit mode', () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue