Skip to content

Commit 92c3702

Browse files
committed
fixed test
Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>
1 parent 1602155 commit 92c3702

4 files changed

Lines changed: 46 additions & 37 deletions

File tree

frontend/src/routes/Applications/CreateApplication/CreateApplicationArgoPullModel.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -423,15 +423,15 @@ describe('Create Argo Application Set', () => {
423423
await clickByText(channelGit.spec.pathname)
424424
await waitForNocks(appBranchNocks)
425425

426-
await clickByPlaceholderText('Enter or select a tracking revision')
427426
const pathNocks = [
428427
nockArgoGitBranches(channelGit.spec.pathname, { branchList: [{ name: 'branch-01' }] }),
429428
nockArgoGitPathSha(channelGit.spec.pathname, 'branch-01', { commit: { sha: '01' } }),
430429
nockArgoGitPathTree(channelGit.spec.pathname, { tree: [{ path: 'application-test', type: 'tree' }] }),
431430
]
432431

433-
await clickByText('branch-01')
432+
await clickByPlaceholderText('Enter or select a tracking revision')
434433
await waitForNocks(pathNocks)
434+
await clickByText('branch-01')
435435

436436
await clickByPlaceholderText('Enter or select a repository path')
437437
await clickByText('application-test')

frontend/src/routes/Infrastructure/Clusters/ManagedClusters/CreateCluster/components/assisted-installer/hypershift/__snapshots__/DetailsForm.test.tsx.snap

Lines changed: 33 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -305,9 +305,29 @@ exports[`DetailsForm it renders 1`] = `
305305
class="pf-v5-c-helper-text__item pf-m-error"
306306
id="form-input-baseDnsDomain-field-helper"
307307
>
308+
<span
309+
aria-hidden="true"
310+
class="pf-v5-c-helper-text__item-icon"
311+
>
312+
<svg
313+
aria-hidden="true"
314+
class="pf-v5-svg"
315+
fill="currentColor"
316+
height="1em"
317+
role="img"
318+
viewBox="0 0 512 512"
319+
width="1em"
320+
>
321+
<path
322+
d="M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zm-248 50c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"
323+
/>
324+
</svg>
325+
</span>
308326
<span
309327
class="pf-v5-c-helper-text__item-text"
310-
/>
328+
>
329+
Required
330+
</span>
311331
</div>
312332
</div>
313333
</div>
@@ -342,31 +362,22 @@ exports[`DetailsForm it renders 1`] = `
342362
<div
343363
class="pf-v5-c-form__group-control"
344364
>
345-
<span
346-
class="pf-v5-c-form-control"
365+
<button
366+
aria-expanded="false"
367+
class="pf-v5-c-menu-toggle pf-m-full-width pf-v5-u-w-100"
368+
id="form-input-openshiftVersion-field"
369+
type="button"
347370
>
348-
<select
349-
aria-describedby="form-input-openshiftVersion-field-helper"
350-
aria-invalid="false"
351-
data-ouia-component-id="OUIA-Generated-FormSelect-default-1"
352-
data-ouia-component-type="PF5/FormSelect"
353-
data-ouia-safe="true"
354-
id="form-input-openshiftVersion-field"
355-
name="openshiftVersion"
356-
required=""
371+
<span
372+
class="pf-v5-c-menu-toggle__text"
357373
>
358-
<option
359-
class=""
360-
value="ocp-release48"
361-
>
362-
OpenShift 4.8.15-x86_64
363-
</option>
364-
</select>
374+
OpenShift 4.8.15-x86_64
375+
</span>
365376
<span
366-
class="pf-v5-c-form-control__utilities"
377+
class="pf-v5-c-menu-toggle__controls"
367378
>
368379
<span
369-
class="pf-v5-c-form-control__toggle-icon"
380+
class="pf-v5-c-menu-toggle__toggle-icon"
370381
>
371382
<svg
372383
aria-hidden="true"
@@ -383,7 +394,7 @@ exports[`DetailsForm it renders 1`] = `
383394
</svg>
384395
</span>
385396
</span>
386-
</span>
397+
</button>
387398
</div>
388399
</div>
389400
<div

frontend/src/wizards/Argo/ArgoWizard.test.tsx

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -168,13 +168,13 @@ describe('ArgoWizard tests', () => {
168168
}),
169169
'testapp'
170170
)
171-
userEvent.click(screen.getByText(/select the argo server/i))
171+
userEvent.click(screen.getByPlaceholderText(/select the argo server/i))
172172
userEvent.click(
173173
screen.getByRole('option', {
174174
name: /http:\/\/argoserver\.com/i,
175175
})
176176
)
177-
userEvent.click(screen.getByText(/180/i))
177+
userEvent.click(screen.getByPlaceholderText(/select the requeue time/i))
178178
userEvent.click(
179179
screen.getByRole('option', {
180180
name: /120/i,
@@ -190,11 +190,10 @@ describe('ArgoWizard tests', () => {
190190
// template page
191191
//=====================================================================
192192
userEvent.click(screen.getByText(/use a git repository/i))
193-
userEvent.click(screen.getByText(/enter or select a git url/i))
194-
userEvent.type(screen.getByRole('searchbox'), 'https://github.com/fxiang1/app-samples')
193+
userEvent.type(screen.getByPlaceholderText(/enter or select a git url/i), 'https://github.com/fxiang1/app-samples')
195194
userEvent.click(
196195
screen.getByRole('option', {
197-
name: /create "https:\/\/github\.com\/fxiang1\/app-samples"/i,
196+
name: /create new option https:\/\/github\.com\/fxiang1\/app-samples/i,
198197
})
199198
)
200199
const dropdown = container.querySelector(
@@ -318,7 +317,7 @@ describe('ArgoWizard tests', () => {
318317
}),
319318
'testapp'
320319
)
321-
userEvent.click(screen.getByText(/select the argo server/i))
320+
userEvent.click(screen.getByPlaceholderText(/select the argo server/i))
322321
userEvent.click(
323322
screen.getByRole('option', {
324323
name: /http:\/\/argoserver\.com/i,
@@ -334,11 +333,10 @@ describe('ArgoWizard tests', () => {
334333
// template page
335334
//=====================================================================
336335
userEvent.click(screen.getByText(/use a helm repository/i))
337-
userEvent.click(screen.getByText(/enter or select a helm url/i))
338-
userEvent.type(screen.getByRole('searchbox'), 'https://github.com/fxiang1/app-samples')
336+
userEvent.type(screen.getByPlaceholderText(/enter or select a helm url/i), 'https://github.com/fxiang1/app-samples')
339337
userEvent.click(
340338
screen.getByRole('option', {
341-
name: /create "https:\/\/github\.com\/fxiang1\/app-samples"/i,
339+
name: /create new option https:\/\/github\.com\/fxiang1\/app-samples/i,
342340
})
343341
)
344342
userEvent.type(
@@ -366,7 +364,7 @@ describe('ArgoWizard tests', () => {
366364
userEvent.click(screen.getByText(/existing placement/i))
367365
userEvent.click(
368366
screen.getByRole('button', {
369-
name: /options menu/i,
367+
name: /menu toggle/i,
370368
})
371369
)
372370
userEvent.click(

frontend/src/wizards/Governance/PolicySet/PolicySetWizard.test.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@ describe('PolicySetWizard wizard', () => {
4242

4343
screen.getByRole('button', { name: /placement/i }).click()
4444
screen.getByRole('button', { name: /new placement/i }).click()
45-
await waitFor(() => screen.getByText(/select the cluster sets/i))
45+
await waitFor(() => screen.getByPlaceholderText(/select the cluster sets/i))
4646
const placementName = container.querySelector('#name-form-group #name')?.getAttribute('value')
4747
expect(placementName).toEqual('test-policy-placement')
4848

49-
screen.getByText(/select the cluster sets/i).click()
49+
screen.getByPlaceholderText(/select the cluster sets/i).click()
5050
expect(screen.getByRole('button', { name: /Add cluster set/i })).not.toBeNull()
5151

52-
expect(screen.getByRole('checkbox', { name: /cluster-set-01/i })).not.toBeNull()
52+
expect(screen.getByRole('option', { name: /cluster-set-01/i })).not.toBeNull()
5353
})
5454
})

0 commit comments

Comments
 (0)