Skip to content

Commit

Permalink
Fix message bar and logout tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Vincent Petry committed Dec 12, 2019
1 parent 221082d commit b7efbdc
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
9 changes: 6 additions & 3 deletions src/Phoenix.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<router-view name="fullscreen"></router-view>
</template>
<template v-else>
<message-bar />
<message-bar :active-messages="activeMessages" @deleteMessage="$_deleteMessage" />
<top-bar :applicationsList="$_applicationsList" :activeNotifications="activeNotifications" :user-id="user.id" :user-display-name="user.displayname" :hasAppNavigation="!!appNavigationEntries.length" @toggleAppNavigation="$_toggleAppNavigation(!appNavigationVisible)"></top-bar>
<side-menu :visible="appNavigationVisible" :entries="appNavigationEntries" @closed="$_toggleAppNavigation(false)"></side-menu>
<main id="main">
Expand Down Expand Up @@ -69,7 +69,7 @@ export default {
},
computed: {
...mapState(['route', 'user']),
...mapGetters(['configuration', 'activeNotifications']),
...mapGetters(['configuration', 'activeNotifications', 'activeMessages']),
$_applicationsList () {
return this.configuration.applications
},
Expand All @@ -95,7 +95,7 @@ export default {
}
},
methods: {
...mapActions(['initAuth', 'fetchNotifications']),
...mapActions(['initAuth', 'fetchNotifications', 'deleteMessage']),
$_toggleAppNavigation (state) {
this.appNavigationVisible = state
},
Expand All @@ -104,6 +104,9 @@ export default {
console.error('Error while loading notifications: ', error)
clearInterval(this.$_notificationsInterval)
})
},
$_deleteMessage (item) {
this.deleteMessage(item)
}
},
watch: {
Expand Down
2 changes: 1 addition & 1 deletion src/components/UserMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<span v-if="userEmail">{{ userEmail }}</span>
<router-link to="/account" target="_blank"><translate>Manage your account</translate></router-link>
<br/>
<oc-button type="a" @click="logout()"><translate>Log out</translate></oc-button>
<oc-button id="logoutMenuItem" type="a" @click="logout()"><translate>Log out</translate></oc-button>
</div>
<div class="uk-card-footer uk-flex uk-flex-middle uk-flex-column">
<span>Version: {{appVersion.version}}-{{appVersion.hash}} ({{appVersion.buildDate}})</span>
Expand Down
4 changes: 2 additions & 2 deletions tests/acceptance/helpers/loginHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ module.exports = {
const phoenixPage = client.page.phoenixPage()
return phoenixPage
.navigate()
.waitForElementVisible('@menuButton')
.click('@menuButton')
.waitForElementVisible('@userMenuButton')
.click('@userMenuButton')
.waitForElementVisible('@logoutMenuItem')
.waitForAnimationToFinish()
.click('@logoutMenuItem')
Expand Down
3 changes: 3 additions & 0 deletions tests/acceptance/pageObjects/phoenixPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,9 @@ module.exports = {
searchLoadingIndicator: {
selector: '.oc-app-bar .uk-spinner'
},
userMenuButton: {
selector: '#_userMenuButton'
},
menuButton: {
selector: '//button[@aria-label="Menu"]',
locateStrategy: 'xpath'
Expand Down

0 comments on commit b7efbdc

Please sign in to comment.