Skip to content

Commit

Permalink
test: check presence of locales menu
Browse files Browse the repository at this point in the history
  • Loading branch information
caro3801 committed Sep 26, 2024
1 parent 8b16fb9 commit dba644f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
13 changes: 10 additions & 3 deletions src/views/Login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,16 @@
@click="image.shake()"
/>
</div>
<div class="login-view__help d-flex flex-column align-items-center justify-content-end gap-2">
<button-icon :label="askHelpLabel" tag="a" :href="helpLink" variant="outline-secondary" @click="image.shake()" />
<div class="d-flex align-items-center gap-2">
<div class="login-view__assistance d-flex flex-column align-items-center justify-content-end gap-2">
<button-icon
class="login-view__assistance__help"
:label="askHelpLabel"
tag="a"
:href="helpLink"
variant="outline-secondary"
@click="image.shake()"
/>
<div class="login-view__assistance__locale d-flex align-items-center gap-2">
<span>{{ switchLanguageLabel }}</span
><locales-menu class="px-2" />
</div>
Expand Down
6 changes: 5 additions & 1 deletion tests/unit/specs/views/Login.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ describe('Login.vue', () => {
})

it('should display a help link', () => {
expect(wrapper.findAll('.login-view__help .btn').at(1).text()).toBe('Ask for help')
expect(wrapper.find('.login-view__assistance__help').text()).toBe('Ask for help')
})
it('should show the locale menu with the current locale', () => {
expect(wrapper.find('.locales-menu').text()).toBe('English')
expect(wrapper.find('.locales-menu').exists()).toBe(true)
})
})

0 comments on commit dba644f

Please sign in to comment.