mirror of https://github.com/nocodb/nocodb
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
1.3 KiB
49 lines
1.3 KiB
2 years ago
|
import { mount } from '@vue/test-utils'
|
||
|
import { expect, test } from 'vitest'
|
||
|
import Sponsors from './Sponsors.vue'
|
||
|
import { createVuetifyPlugin } from '~/plugins/vuetify'
|
||
2 years ago
|
import { createI18nPlugin } from '~/plugins/a.i18n'
|
||
2 years ago
|
|
||
2 years ago
|
const mountComponent = async (nav: boolean) => {
|
||
2 years ago
|
const vuetify = createVuetifyPlugin()
|
||
|
const i18n = await createI18nPlugin()
|
||
|
|
||
|
const wrapper = mount(Sponsors, {
|
||
|
global: {
|
||
2 years ago
|
plugins: [vuetify, i18n],
|
||
2 years ago
|
},
|
||
|
props: {
|
||
2 years ago
|
nav,
|
||
2 years ago
|
},
|
||
|
})
|
||
2 years ago
|
|
||
|
return {
|
||
|
wrapper,
|
||
|
i18n,
|
||
|
}
|
||
|
}
|
||
|
|
||
|
test('Sponsors component tests', async () => {
|
||
|
const { wrapper, i18n } = await mountComponent(false)
|
||
|
|
||
|
const image = await wrapper.get('img')
|
||
|
|
||
|
expect(image.attributes('src')).toBe('/ants-leaf-cutter.jpeg')
|
||
|
|
||
|
expect(wrapper.get('.v-card-title').text()).toBe(i18n.global.t('msg.info.sponsor.header'))
|
||
|
|
||
|
expect(wrapper.get('.v-card-text').text()).toBe(i18n.global.t('msg.info.sponsor.message'))
|
||
|
|
||
|
expect(wrapper.get('.v-btn').text()).toBe(i18n.global.t('activity.sponsorUs'))
|
||
|
})
|
||
|
|
||
|
test('Sponsors component tests in nav', async () => {
|
||
|
const { wrapper, i18n } = await mountComponent(true)
|
||
|
|
||
|
const image = await wrapper.get('img')
|
||
|
|
||
|
expect(image.attributes('src')).toBe('/ants-leaf-cutter.jpeg')
|
||
|
|
||
|
expect(wrapper.get('.v-btn').text()).toBe(i18n.global.t('activity.sponsorUs'))
|
||
2 years ago
|
})
|