Skip to content

Commit

Permalink
add page title to sign in
Browse files Browse the repository at this point in the history
  • Loading branch information
Mogge committed Mar 27, 2024
1 parent d06eed8 commit f39ff5f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
5 changes: 4 additions & 1 deletion frontend/src/pages/signin/+Page.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
<template>
<div class="h-screen auth-page py-12">{{ $t('auth.signin') }}</div>
<DefaultLayout>
<div class="h-screen auth-page py-12">{{ $t('auth.signin') }}</div>
</DefaultLayout>
</template>

<script lang="ts" setup>
import { navigate } from 'vike/client/router'
import { inject, onBeforeMount } from 'vue'
import DefaultLayout from '#layouts/DefaultLayout.vue'
import AuthService from '#src/services/AuthService'
import { useAuthStore } from '#stores/authStore'
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/pages/signin/+title.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import i18n from '#plugins/i18n'

export const title = () => i18n.global.t('auth.title')
6 changes: 6 additions & 0 deletions frontend/src/pages/signin/Page.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ import { describe, it, expect, beforeEach, vi } from 'vitest'
import { Component, h } from 'vue'
import { VApp } from 'vuetify/components'

import i18n from '#plugins/i18n'
import { useAuthStore } from '#stores/authStore'
import { authService } from '#tests/mock.authService'

import SigninPage from './+Page.vue'
import { title } from './+title'

vi.mock('vike/client/router')
vi.mocked(navigate).mockResolvedValue()
Expand All @@ -24,6 +26,10 @@ describe('SigninPage', () => {
const authServiceSpy = vi.spyOn(authService, 'signIn')

describe('not signed in', () => {
it('title returns correct title', () => {
expect(title()).toBe(i18n.global.t('auth.title'))
})

describe('signin without error', () => {
beforeEach(() => {
vi.clearAllMocks()
Expand Down

0 comments on commit f39ff5f

Please sign in to comment.