forked from Ivasoft/geovisio-website
fix some test
This commit is contained in:
@@ -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}`
|
||||
}
|
||||
|
||||
@@ -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 =>
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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"')
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user