diff options
author | Derick Montague <derick.montague@ibm.com> | 2020-07-24 01:24:39 +0300 |
---|---|---|
committer | Derick Montague <derick.montague@ibm.com> | 2020-07-27 19:17:48 +0300 |
commit | 965cf673ec7179d5cc09c656f5508eee4fc71712 (patch) | |
tree | 5129f52413fbd61380ad5694d445c17089d92d1f | |
parent | d388a28b478bf0224e37e292f8bc30fabe2c7059 (diff) | |
download | webui-vue-965cf673ec7179d5cc09c656f5508eee4fc71712.tar.xz |
Add application header test hooks
We are not able to easily pass the data attribute to the markup created
by some of the Bootstrap-vue components. In these cases we are adding
the data attribute to the parent container. Those elements will use the
word container in the data attribute value.
Signed-off-by: Derick Montague <derick.montague@ibm.com>
Change-Id: I5f1cb43aaed9233415e9b7b9a7f71580f27f921d
-rw-r--r-- | src/components/AppHeader/AppHeader.vue | 37 |
1 files changed, 29 insertions, 8 deletions
diff --git a/src/components/AppHeader/AppHeader.vue b/src/components/AppHeader/AppHeader.vue index b977b5f9..568f9188 100644 --- a/src/components/AppHeader/AppHeader.vue +++ b/src/components/AppHeader/AppHeader.vue @@ -33,33 +33,54 @@ </b-navbar-nav> <!-- Right aligned nav items --> <b-navbar-nav class="ml-auto helper-menu"> - <b-nav-item to="/health/event-logs"> + <b-nav-item + to="/health/event-logs" + data-test-id="appHeader-container-health" + > <status-icon :status="healthStatusIcon" /> {{ $t('appHeader.health') }} </b-nav-item> - <b-nav-item to="/control/server-power-operations"> + <b-nav-item + to="/control/server-power-operations" + data-test-id="appHeader-container-power" + > <status-icon :status="hostStatusIcon" /> {{ $t('appHeader.power') }} </b-nav-item> <!-- Using LI elements instead of b-nav-item to support semantic button elements --> <li class="nav-item"> - <b-button id="app-header-refresh" variant="link" @click="refresh"> + <b-button + id="app-header-refresh" + variant="link" + data-test-id="appHeader-button-refresh" + @click="refresh" + > <icon-renew /> <span class="responsive-text">{{ $t('appHeader.refresh') }}</span> </b-button> </li> <li class="nav-item"> - <b-dropdown id="app-header-user" variant="link" right> + <b-dropdown + id="app-header-user" + variant="link" + right + data-test-id="appHeader-container-user" + > <template v-slot:button-content> <icon-avatar /> <span class="responsive-text">{{ username }}</span> </template> - <b-dropdown-item to="/profile-settings" + <b-dropdown-item + to="/profile-settings" + data-test-id="appHeader-link-profile" >{{ $t('appHeader.profileSettings') }} </b-dropdown-item> - <b-dropdown-item @click="logout">{{ - $t('appHeader.logOut') - }}</b-dropdown-item> + <b-dropdown-item + data-test-id="appHeader-link-logout" + @click="logout" + > + {{ $t('appHeader.logOut') }} + </b-dropdown-item> </b-dropdown> </li> </b-navbar-nav> |