Skip to content

Commit

Permalink
Fix login tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wenincode committed Nov 6, 2023
1 parent ee0c342 commit c0d5bd7
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@

<Hds::Dropdown class="hds-side-nav__dropdown" @listPosition="left" as |dd|>

<dd.ToggleIcon @icon="user" @text="Account menu" />
<dd.ToggleIcon @icon="user" @text="Auth menu" data-test-auth-menu />
<dd.Interactive
@href={{href-to
"settings"
Expand All @@ -68,6 +68,7 @@
/>
<dd.Interactive
@text="Sign in"
data-test-auth-menu-signin
{{on "click" (optional this.modal.open)}}
/>
</Hds::Dropdown>
Expand Down Expand Up @@ -108,7 +109,7 @@
</ModalDialog>

<Hds::Dropdown class="hds-side-nav__dropdown" @listPosition="left" as |dd|>
<dd.ToggleIcon @icon="user" @text="Account menu" />
<dd.ToggleIcon @icon="user" @text="Auth menu" data-test-auth-menu />
{{#if authDialog.token.AccessorID}}
<dd.Title @text="Signed in with ACL Token" />
<dd.Description
Expand All @@ -129,6 +130,7 @@
/>
<dd.Interactive
@text="Sign out"
data-test-auth-menu-signout
{{on "click" (optional authDialog.logout)}}
/>
</Hds::Dropdown>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
</:notifications>

<:side-nav>
<Hds::SideNav @isResponsive={{true}} @isCollapsible={{true}} class='consul-side-nav'>
<Hds::SideNav @isResponsive={{true}} @isCollapsible={{true}} class='consul-side-nav' data-test-navigation>
<:header>
<Hds::SideNav::Header>
<:logo>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ export default (collection, clickable, attribute, is, authForm, emptyState) => (
status: attribute('data-test-status', '[data-test-status]'),
},
};
page.navigation.login = clickable('[data-test-main-nav-auth] button');
page.navigation.authMenu = clickable('[data-test-auth-menu]');
page.navigation.login = clickable('[data-test-auth-menu-signin]');
page.navigation.dc = clickable('[data-test-datacenter-menu] button');
page.navigation.nspace = clickable('[data-test-nspace-menu] button');
page.navigation.manageNspaces = clickable('[data-test-main-nav-nspaces] a');
Expand Down
4 changes: 4 additions & 0 deletions ui/packages/consul-ui/tests/acceptance/login.feature
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Feature: login
dc: dc-1
---
Then the url should be /dc-1/acls/tokens
And I click ".hds-side-nav__toggle-button"
And I click authMenu on the navigation
And I click login on the navigation
And I fill in the auth form with yaml
---
Expand Down Expand Up @@ -39,6 +41,8 @@ Feature: login
state: state-123456789/abcdefghijklmnopqrstuvwxyz
code: code-abcdefghijklmnopqrstuvwxyz/123456789
---
And I click ".hds-side-nav__toggle-button"
And I click authMenu on the navigation
And I click login on the navigation
And I click "[data-test-tab=tab_sso] button"
Then the "[name='partition']" input should have the value "default"
Expand Down

0 comments on commit c0d5bd7

Please sign in to comment.