Skip to content

Commit 01099c9

Browse files
committed
test: Adjust tests
1 parent f061803 commit 01099c9

21 files changed

+20
-64
lines changed

src/test/Components/CreateImageWizard/steps/Details/Details.test.tsx

-9
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import { detailsCreateBlueprintRequest } from '../../../../fixtures/editMode';
77
import { clickNext, getNextButton } from '../../wizardTestUtils';
88
import {
99
blueprintRequest,
10-
clickRegisterLater,
1110
enterBlueprintName,
1211
goToRegistrationStep,
1312
interceptBlueprintRequest,
@@ -68,7 +67,6 @@ describe('Step Details', () => {
6867
test('with invalid name', async () => {
6968
await renderCreateMode();
7069
await goToRegistrationStep();
71-
await clickRegisterLater();
7270
await goToDetailsStep();
7371
const nextButton = await getNextButton();
7472
expect(nextButton).toBeEnabled();
@@ -79,7 +77,6 @@ describe('Step Details', () => {
7977
test('with valid name', async () => {
8078
await renderCreateMode();
8179
await goToRegistrationStep();
82-
await clickRegisterLater();
8380
await goToDetailsStep();
8481
await enterBlueprintName('🤣Red Velvet🤣');
8582
const nextButton = await getNextButton();
@@ -89,7 +86,6 @@ describe('Step Details', () => {
8986
test('with non-unique name', async () => {
9087
await renderCreateMode();
9188
await goToRegistrationStep();
92-
await clickRegisterLater();
9389
await goToDetailsStep();
9490
await enterBlueprintName('Lemon Pie');
9591
const nextButton = await getNextButton();
@@ -99,7 +95,6 @@ describe('Step Details', () => {
9995
test('name invalid for more than 100 chars', async () => {
10096
await renderCreateMode();
10197
await goToRegistrationStep();
102-
await clickRegisterLater();
10398
await goToDetailsStep();
10499

105100
// enter invalid image name
@@ -117,7 +112,6 @@ describe('Step Details', () => {
117112
test('description invalid for more than 250', async () => {
118113
await renderCreateMode();
119114
await goToRegistrationStep();
120-
await clickRegisterLater();
121115
await goToDetailsStep();
122116

123117
// enter invalid image description
@@ -135,7 +129,6 @@ describe('Step Details', () => {
135129
test('revisit step button on Review works', async () => {
136130
await renderCreateMode();
137131
await goToRegistrationStep();
138-
await clickRegisterLater();
139132
await goToDetailsStep();
140133
await goToReviewStep();
141134
await clickRevisitButton();
@@ -151,7 +144,6 @@ describe('Details request generated correctly', () => {
151144
test('without description', async () => {
152145
await renderCreateMode();
153146
await goToRegistrationStep();
154-
await clickRegisterLater();
155147
await goToDetailsStep();
156148
await enterBlueprintName();
157149
await goToReviewStep();
@@ -168,7 +160,6 @@ describe('Details request generated correctly', () => {
168160
test('with description', async () => {
169161
await renderCreateMode();
170162
await goToRegistrationStep();
171-
await clickRegisterLater();
172163
await goToDetailsStep();
173164
await enterBlueprintName();
174165
await enterBlueprintDescription();

src/test/Components/CreateImageWizard/steps/FileSystemConfiguration/FileSystemConfiguration.test.tsx

-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import {
1717
} from '../../wizardTestUtils';
1818
import {
1919
blueprintRequest,
20-
clickRegisterLater,
2120
enterBlueprintName,
2221
interceptBlueprintRequest,
2322
interceptEditBlueprintRequest,
@@ -44,7 +43,6 @@ const selectImageInstaller = async () => {
4443

4544
const goToFileSystemConfigurationStep = async () => {
4645
await clickNext(); // Registration
47-
await clickRegisterLater();
4846
await clickNext(); // OpenSCAP
4947
await clickNext(); // File System
5048
};

src/test/Components/CreateImageWizard/steps/Firewall/Firewall.test.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {
1616
renderEditMode,
1717
verifyCancelButton,
1818
} from '../../wizardTestUtils';
19-
import { clickRegisterLater, renderCreateMode } from '../../wizardTestUtils';
19+
import { renderCreateMode } from '../../wizardTestUtils';
2020

2121
let router: RemixRouter | undefined = undefined;
2222

@@ -27,7 +27,6 @@ const goToFirewallStep = async () => {
2727
});
2828
await waitFor(() => user.click(guestImageCheckBox));
2929
await clickNext(); // Registration
30-
await clickRegisterLater();
3130
await clickNext(); // OpenSCAP
3231
await clickNext(); // File system configuration
3332
await clickNext(); // Snapshots

src/test/Components/CreateImageWizard/steps/FirstBoot/Firstboot.test.tsx

-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import {
2323
} from '../../wizardTestUtils';
2424
import {
2525
blueprintRequest,
26-
clickRegisterLater,
2726
enterBlueprintName,
2827
interceptBlueprintRequest,
2928
interceptEditBlueprintRequest,
@@ -39,7 +38,6 @@ const goToFirstBootStep = async (): Promise<void> => {
3938
});
4039
await waitFor(() => user.click(guestImageCheckBox));
4140
await clickNext(); // Registration
42-
await clickRegisterLater();
4341
await clickNext(); // OpenSCAP
4442
await clickNext(); // File system configuration
4543
await clickNext(); // Repository snapshot

src/test/Components/CreateImageWizard/steps/Hostname/Hostname.test.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import {
1717
renderEditMode,
1818
verifyCancelButton,
1919
} from '../../wizardTestUtils';
20-
import { clickRegisterLater, renderCreateMode } from '../../wizardTestUtils';
20+
import { renderCreateMode } from '../../wizardTestUtils';
2121

2222
let router: RemixRouter | undefined = undefined;
2323

@@ -28,7 +28,6 @@ const goToHostnameStep = async () => {
2828
});
2929
await waitFor(() => user.click(guestImageCheckBox));
3030
await clickNext(); // Registration
31-
await clickRegisterLater();
3231
await clickNext(); // OpenSCAP
3332
await clickNext(); // File system configuration
3433
await clickNext(); // Snapshots

src/test/Components/CreateImageWizard/steps/ImageOutput/ImageOutput.test.tsx

-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ import {
3131
} from '../../wizardTestUtils';
3232
import {
3333
blueprintRequest,
34-
clickRegisterLater,
3534
enterBlueprintName,
3635
imageRequest,
3736
interceptBlueprintRequest,
@@ -129,7 +128,6 @@ const selectVMwareTarget = async () => {
129128

130129
const goToReviewStep = async () => {
131130
await clickNext(); // Registration
132-
await clickRegisterLater();
133131
await clickNext(); // OpenSCAP
134132
await clickNext(); // File system customization
135133
await clickNext(); // Repository snapshot

src/test/Components/CreateImageWizard/steps/Kernel/Kernel.test.tsx

+1-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import {
1717
renderEditMode,
1818
verifyCancelButton,
1919
} from '../../wizardTestUtils';
20-
import { clickRegisterLater, renderCreateMode } from '../../wizardTestUtils';
20+
import { renderCreateMode } from '../../wizardTestUtils';
2121

2222
let router: RemixRouter | undefined = undefined;
2323

@@ -30,7 +30,6 @@ const goToKernelStep = async () => {
3030
});
3131
await waitFor(() => user.click(guestImageCheckBox));
3232
await clickNext(); // Registration
33-
await clickRegisterLater();
3433
await clickNext(); // OpenSCAP
3534
await clickNext(); // File system configuration
3635
await clickNext(); // Snapshots
@@ -50,7 +49,6 @@ const goToOpenSCAPStep = async () => {
5049
});
5150
await waitFor(() => user.click(guestImageCheckBox));
5251
await clickNext(); // Registration
53-
await clickRegisterLater();
5452
await clickNext(); // OpenSCAP
5553
};
5654

src/test/Components/CreateImageWizard/steps/Locale/Locale.test.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {
1616
renderEditMode,
1717
verifyCancelButton,
1818
} from '../../wizardTestUtils';
19-
import { clickRegisterLater, renderCreateMode } from '../../wizardTestUtils';
19+
import { renderCreateMode } from '../../wizardTestUtils';
2020

2121
let router: RemixRouter | undefined = undefined;
2222

@@ -27,7 +27,6 @@ const goToLocaleStep = async () => {
2727
});
2828
await waitFor(() => user.click(guestImageCheckBox));
2929
await clickNext(); // Registration
30-
await clickRegisterLater();
3130
await clickNext(); // OpenSCAP
3231
await clickNext(); // File system configuration
3332
await clickNext(); // Snapshots

src/test/Components/CreateImageWizard/steps/Oscap/Compliance.test.tsx

-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import { mockBlueprintIds } from '../../../../fixtures/blueprints';
77
import { complianceCreateBlueprintRequest } from '../../../../fixtures/editMode';
88
import { clickNext } from '../../wizardTestUtils';
99
import {
10-
clickRegisterLater,
1110
enterBlueprintName,
1211
interceptBlueprintRequest,
1312
interceptEditBlueprintRequest,
@@ -36,7 +35,6 @@ const goToComplianceStep = async () => {
3635
});
3736
await waitFor(() => user.click(guestImageCheckBox));
3837
await clickNext(); // Registration
39-
await clickRegisterLater();
4038
await clickNext(); // Compliance
4139
await screen.findByRole('heading', { name: /Compliance/ });
4240
const button = await screen.findByLabelText('Insights compliance');

src/test/Components/CreateImageWizard/steps/Packages/Packages.test.tsx

-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import {
2121
import { selectCustomRepo } from '../../wizardTestUtils';
2222
import {
2323
blueprintRequest,
24-
clickRegisterLater,
2524
enterBlueprintName,
2625
interceptBlueprintRequest,
2726
interceptEditBlueprintRequest,
@@ -43,7 +42,6 @@ const selectGuestImageTarget = async () => {
4342
const goToPackagesStep = async () => {
4443
await selectGuestImageTarget();
4544
await clickNext(); // Registration
46-
await clickRegisterLater();
4745
await clickNext(); // OpenSCAP
4846
await clickNext(); // File system configuration
4947
await clickNext(); // Repository snapshot

src/test/Components/CreateImageWizard/steps/Registration/Registration.test.tsx

+10-5
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ import {
2121
renderCreateMode,
2222
interceptBlueprintRequest,
2323
goToRegistrationStep,
24-
clickRegisterLater,
2524
renderEditMode,
2625
interceptEditBlueprintRequest,
2726
openAndDismissSaveAndBuildModal,
2827
clickNext,
2928
clickBack,
3029
verifyCancelButton,
3130
clickReviewAndFinish,
31+
clickRegisterCheckbox,
3232
} from '../../wizardTestUtils';
3333

3434
const localStorageMock = (() => {
@@ -124,7 +124,6 @@ describe('Step Registration', () => {
124124
test('clicking Next leads to OpenSCAP step', async () => {
125125
await renderCreateMode();
126126
await goToRegistrationStep();
127-
await clickRegisterLater();
128127
await clickNext();
129128
await screen.findByRole('heading', {
130129
name: 'OpenSCAP profile',
@@ -164,6 +163,7 @@ describe('Step Registration', () => {
164163

165164
await renderCreateMode();
166165
await goToRegistrationStep();
166+
await clickRegisterCheckbox();
167167
expect(
168168
await screen.findByRole('button', { name: /Review and finish/ })
169169
).toBeDisabled();
@@ -172,6 +172,7 @@ describe('Step Registration', () => {
172172
test('default registration includes rhsm, rhc and insights', async () => {
173173
await renderCreateMode();
174174
await goToRegistrationStep();
175+
await clickRegisterCheckbox();
175176
await openActivationKeyDropdown();
176177
await selectActivationKey('name0');
177178
await goToReviewStep();
@@ -186,10 +187,9 @@ describe('Step Registration', () => {
186187
);
187188
});
188189

189-
test('should disable dropdown when clicking Register the system later', async () => {
190+
test('should disable dropdown for Register the system later', async () => {
190191
await renderCreateMode();
191192
await goToRegistrationStep();
192-
await clickRegisterLater();
193193

194194
await waitFor(() =>
195195
expect(
@@ -208,6 +208,7 @@ describe('Step Registration', () => {
208208
test('revisit step button on Review works', async () => {
209209
await renderCreateMode();
210210
await goToRegistrationStep();
211+
await clickRegisterCheckbox();
211212
await openActivationKeyDropdown();
212213
await selectActivationKey('name0');
213214
await goToReviewStep();
@@ -243,6 +244,7 @@ describe('Registration request generated correctly', () => {
243244
test('register + insights + rhc', async () => {
244245
await renderCreateMode();
245246
await goToRegistrationStep();
247+
await clickRegisterCheckbox();
246248
await goToReviewStep();
247249
// informational modal pops up in the first test only as it's tied
248250
// to a 'imageBuilder.saveAndBuildModalSeen' variable in localStorage
@@ -268,6 +270,7 @@ describe('Registration request generated correctly', () => {
268270
test('register + insights', async () => {
269271
await renderCreateMode();
270272
await goToRegistrationStep();
273+
await clickRegisterCheckbox();
271274
await clickShowAdditionalConnectionOptions();
272275
await deselectEnableRemoteRemediations();
273276
await goToReviewStep();
@@ -292,6 +295,7 @@ describe('Registration request generated correctly', () => {
292295
test('register now', async () => {
293296
await renderCreateMode();
294297
await goToRegistrationStep();
298+
await clickRegisterCheckbox();
295299
await clickShowAdditionalConnectionOptions();
296300
await deselectPredictiveAnalytics();
297301
await goToReviewStep();
@@ -320,7 +324,6 @@ describe('Registration request generated correctly', () => {
320324
test('register later', async () => {
321325
await renderCreateMode();
322326
await goToRegistrationStep();
323-
await clickRegisterLater();
324327
await goToReviewStep();
325328
const receivedRequest = await interceptBlueprintRequest(CREATE_BLUEPRINT);
326329

@@ -337,6 +340,7 @@ describe('Registration request generated correctly', () => {
337340
test('register with no key in local storage', async () => {
338341
await renderCreateMode();
339342
await goToRegistrationStep();
343+
await clickRegisterCheckbox();
340344

341345
await screen.findByDisplayValue('name0');
342346
await goToReviewStep();
@@ -364,6 +368,7 @@ describe('Registration request generated correctly', () => {
364368
await renderCreateMode();
365369
localStorage.setItem('imageBuilder.recentActivationKey', 'name1');
366370
await goToRegistrationStep();
371+
await clickRegisterCheckbox();
367372

368373
await screen.findByDisplayValue('name1');
369374
await goToReviewStep();

src/test/Components/CreateImageWizard/steps/Repositories/Repositories.test.tsx

-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import {
2020
} from '../../wizardTestUtils';
2121
import {
2222
blueprintRequest,
23-
clickRegisterLater,
2423
enterBlueprintName,
2524
interceptBlueprintRequest,
2625
interceptEditBlueprintRequest,
@@ -36,7 +35,6 @@ const goToRepositoriesStep = async () => {
3635
});
3736
await waitFor(() => user.click(guestImageCheckBox));
3837
await clickNext(); // Registration
39-
await clickRegisterLater();
4038
await clickNext(); // OpenSCAP
4139
await clickNext(); // File system configuration
4240
await clickNext(); // Repository snapshot

src/test/Components/CreateImageWizard/steps/Review/Review.test.tsx

-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import userEvent from '@testing-library/user-event';
55
import {
66
clickBack,
77
clickNext,
8-
clickRegisterLater,
98
renderCreateMode,
109
verifyCancelButton,
1110
} from '../../wizardTestUtils';
@@ -47,7 +46,6 @@ const setupWithCentos = async () => {
4746

4847
const goToReviewStep = async () => {
4948
await clickNext(); // Registration
50-
await clickRegisterLater();
5149
await clickNext(); // OpenSCAP
5250
await clickNext(); // File system configuration
5351
await clickNext(); // Repository snapshot

src/test/Components/CreateImageWizard/steps/Services/Services.test.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@ import {
77
blueprintRequest,
88
clickBack,
99
clickNext,
10+
clickRegisterCheckbox,
1011
enterBlueprintName,
1112
interceptBlueprintRequest,
1213
openAndDismissSaveAndBuildModal,
1314
verifyCancelButton,
1415
} from '../../wizardTestUtils';
15-
import { clickRegisterLater, renderCreateMode } from '../../wizardTestUtils';
16+
import { renderCreateMode } from '../../wizardTestUtils';
1617

1718
let router: RemixRouter | undefined = undefined;
1819

@@ -23,7 +24,6 @@ const goToServicesStep = async () => {
2324
});
2425
await waitFor(() => user.click(guestImageCheckBox));
2526
await clickNext(); // Registration
26-
await clickRegisterLater();
2727
await clickNext(); // OpenSCAP
2828
await clickNext(); // File system configuration
2929
await clickNext(); // Snapshots
@@ -45,7 +45,7 @@ const goToOpenSCAPStep = async () => {
4545
});
4646
await waitFor(() => user.click(guestImageCheckBox));
4747
await clickNext(); // Registration
48-
await clickRegisterLater();
48+
await clickRegisterCheckbox();
4949
await clickNext(); // OpenSCAP
5050
};
5151

0 commit comments

Comments
 (0)