fix some test

This commit is contained in:
Andreani Jean
2023-05-04 11:42:18 +02:00
parent 08d6e37dad
commit 1fc74a2cf5
4 changed files with 6 additions and 4 deletions

View File

@@ -23,8 +23,6 @@ onMounted(async () => {
const isKeycloakLogout = await axios.get(loginUrl)
const isSiteLogin = !!cookies.get('user_id')
if (isKeycloakLogout || !isSiteLogin) {
cookies.remove('user_id')
cookies.remove('user_name')
const win: Window = window
win.location = `${loginUrl}?next_url=${route.path}`
}

View File

@@ -102,7 +102,8 @@ let hrefSection = ref<string>('#sec-2')
let icon = ref<string>('bi bi-chevron-down')
const loginUrl = computed<string>(
() => `${import.meta.env.VITE_API_URL}api/auth/login?next_url=${route.path}`
() =>
`${import.meta.env.VITE_API_URL}api/auth/login?next_url=partager-des-photos`
)
const isLogged = computed((): boolean => !!cookies.get('user_id'))
const terminalTextInstall = computed((): string =>

View File

@@ -3,7 +3,7 @@ import { shallowMount } from '@vue/test-utils'
import MyAccountView from '../MyAccountView.vue'
describe('Template', () => {
it('should render the view with the iframe', () => {
it('should render the view with the iframe', async () => {
import.meta.env.VITE_API_URL = 'api-url/'
const wrapper = shallowMount(MyAccountView)

View File

@@ -16,6 +16,7 @@ const i18n = createI18n({
describe('Template', () => {
it('should render the view with the button link', async () => {
import.meta.env.VITE_API_URL = 'api-url/'
const wrapper = shallowMount(UploadView, {
global: {
plugins: [i18n],
@@ -24,8 +25,10 @@ describe('Template', () => {
}
}
})
expect(wrapper.html()).contains('<link')
expect(wrapper.html()).contains('path="')
expect(wrapper.html()).contains('/auth/login?next_url=partager-des-photos')
expect(wrapper.html()).contains('look="button"')
expect(wrapper.html()).contains('type="external"')
})