Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jenny-s51 committed Oct 16, 2023
1 parent 8ce4d50 commit 77429ef
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 96 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ describe('AccessConsoles', () => {
expect(screen.getByText('VNC console text')).toBeInTheDocument();

// Open dropdown and select "Serial console" option
await user.click(screen.getByRole('button', { name: 'Options menu' }));
await user.click(screen.getByText('Serial console', { selector: 'button' }));
await user.click(screen.getByRole('button', { name: 'Console type toggle' }));
await user.click(screen.getByText('Serial console'));

// VNC content is no longer visible, and loading contents of the Serial console are visible.
expect(screen.getByText(/Loading/)).toBeInTheDocument();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export const AccessConsoles: React.FunctionComponent<AccessConsolesProps> = ({
ref={toggleRef}
id="pf-v5-c-console__type-selector"
onClick={onToggleClick}
aria-label="Console type toggle"
isExpanded={isOpen}
style={
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,32 +24,22 @@ exports[`AccessConsoles with SerialConsole and VncConsole as children 1`] = `
<div
class="pf-v5-c-console__actions"
>
<div
class="pf-v5-c-select"
data-ouia-component-id="OUIA-Generated-Select-single-1"
data-ouia-component-type="PF5/Select"
data-ouia-safe="true"
<button
aria-expanded="false"
aria-label="Console type toggle"
class="pf-v5-c-menu-toggle"
id="pf-v5-c-console__type-selector"
style="width: 100%;"
type="button"
>
<button
aria-expanded="false"
aria-haspopup="listbox"
aria-label="Options menu"
aria-labelledby=" pf-v5-c-console__type-selector"
class="pf-v5-c-select__toggle"
id="pf-v5-c-console__type-selector"
type="button"
<span
class="pf-v5-c-menu-toggle__text"
/>
<span
class="pf-v5-c-menu-toggle__controls"
>
<div
class="pf-v5-c-select__toggle-wrapper"
>
<span
class="pf-v5-c-select__toggle-text"
>
Select console type
</span>
</div>
<span
class="pf-v5-c-select__toggle-arrow"
class="pf-v5-c-menu-toggle__toggle-icon"
>
<svg
aria-hidden="true"
Expand All @@ -65,8 +55,8 @@ exports[`AccessConsoles with SerialConsole and VncConsole as children 1`] = `
/>
</svg>
</span>
</button>
</div>
</span>
</button>
</div>
</div>
</DocumentFragment>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,21 @@ exports[`VncActions VncActions renders correctly component hierarchy 1`] = `
<div
class="pf-v5-c-console__actions-vnc"
>
<div
class="pf-v5-c-dropdown"
data-ouia-component-id="OUIA-Generated-Dropdown-2"
data-ouia-component-type="PF5/Dropdown"
data-ouia-safe="true"
id="pf-v5-c-console__send-shortcut"
<button
aria-expanded="false"
class="pf-v5-c-menu-toggle"
type="button"
>
<button
aria-expanded="false"
aria-haspopup="true"
class="pf-v5-c-dropdown__toggle"
data-ouia-component-id="OUIA-Generated-DropdownToggle-2"
data-ouia-component-type="PF5/DropdownToggle"
data-ouia-safe="true"
id="pf-v5-c-console__actions-vnc-toggle-id"
type="button"
<span
class="pf-v5-c-menu-toggle__text"
>
My Send Shortcut description
</span>
<span
class="pf-v5-c-menu-toggle__controls"
>
<span
class="pf-v5-c-dropdown__toggle-text"
>
My Send Shortcut description
</span>
<span
class="pf-v5-c-dropdown__toggle-icon"
class="pf-v5-c-menu-toggle__toggle-icon"
>
<svg
aria-hidden="true"
Expand All @@ -44,8 +35,8 @@ exports[`VncActions VncActions renders correctly component hierarchy 1`] = `
/>
</svg>
</span>
</button>
</div>
</span>
</button>
<button
aria-disabled="false"
class="pf-v5-c-button pf-m-secondary"
Expand All @@ -65,30 +56,21 @@ exports[`VncActions VncActions renders correctly html 1`] = `
<div
class="pf-v5-c-console__actions-vnc"
>
<div
class="pf-v5-c-dropdown"
data-ouia-component-id="OUIA-Generated-Dropdown-3"
data-ouia-component-type="PF5/Dropdown"
data-ouia-safe="true"
id="pf-v5-c-console__send-shortcut"
<button
aria-expanded="false"
class="pf-v5-c-menu-toggle"
type="button"
>
<button
aria-expanded="false"
aria-haspopup="true"
class="pf-v5-c-dropdown__toggle"
data-ouia-component-id="OUIA-Generated-DropdownToggle-3"
data-ouia-component-type="PF5/DropdownToggle"
data-ouia-safe="true"
id="pf-v5-c-console__actions-vnc-toggle-id"
type="button"
<span
class="pf-v5-c-menu-toggle__text"
>
My Send Shortcut description
</span>
<span
class="pf-v5-c-menu-toggle__controls"
>
<span
class="pf-v5-c-dropdown__toggle-text"
>
My Send Shortcut description
</span>
<span
class="pf-v5-c-dropdown__toggle-icon"
class="pf-v5-c-menu-toggle__toggle-icon"
>
<svg
aria-hidden="true"
Expand All @@ -104,8 +86,8 @@ exports[`VncActions VncActions renders correctly html 1`] = `
/>
</svg>
</span>
</button>
</div>
</span>
</button>
<button
aria-disabled="false"
class="pf-v5-c-button pf-m-secondary"
Expand All @@ -125,30 +107,21 @@ exports[`VncActions placeholder render test 1`] = `
<div
class="pf-v5-c-console__actions-vnc"
>
<div
class="pf-v5-c-dropdown"
data-ouia-component-id="OUIA-Generated-Dropdown-1"
data-ouia-component-type="PF5/Dropdown"
data-ouia-safe="true"
id="pf-v5-c-console__send-shortcut"
<button
aria-expanded="false"
class="pf-v5-c-menu-toggle"
type="button"
>
<button
aria-expanded="false"
aria-haspopup="true"
class="pf-v5-c-dropdown__toggle"
data-ouia-component-id="OUIA-Generated-DropdownToggle-1"
data-ouia-component-type="PF5/DropdownToggle"
data-ouia-safe="true"
id="pf-v5-c-console__actions-vnc-toggle-id"
type="button"
<span
class="pf-v5-c-menu-toggle__text"
>
Send Key
</span>
<span
class="pf-v5-c-menu-toggle__controls"
>
<span
class="pf-v5-c-dropdown__toggle-text"
>
Send Key
</span>
<span
class="pf-v5-c-dropdown__toggle-icon"
class="pf-v5-c-menu-toggle__toggle-icon"
>
<svg
aria-hidden="true"
Expand All @@ -164,8 +137,8 @@ exports[`VncActions placeholder render test 1`] = `
/>
</svg>
</span>
</button>
</div>
</span>
</button>
<button
aria-disabled="false"
class="pf-v5-c-button pf-m-secondary"
Expand Down

0 comments on commit 77429ef

Please sign in to comment.