Commit 033efacf authored by Jean Rabreau's avatar Jean Rabreau
Browse files

remove noise while loading public project list

parent 219f0f31
Pipeline #59735 passed with stages
in 8 minutes and 1 second
......@@ -21,6 +21,9 @@ describe('RulesMixin', () => {
beforeEach(() => {
wrapper = mountComponent()
})
afterEach(() => {
wrapper.destroy()
})
describe('computed', () => {
describe('passwordModel ', () => {
it('should match component newPassword field', () => {
......
......@@ -64,11 +64,13 @@ describe('store/community', () => {
})
describe('lists', () => {
beforeEach(() => {
getStub.resolves({data: {
getStub.resolves({
data: {
results: [{}, {}],
count: 2,
nextPage: null
} })
}
})
})
describe('loadProjectList', () => {
beforeEach(async () => {
......
......@@ -4,7 +4,6 @@ import App from '@/app'
import router from '@/router'
import i18n from '@/plugins/vue-i18n'
import { settingsStorage as storage } from '@/assets/storage'
import authority from '@/assets/authAxios'
import {mountHelper} from '../../fixtures/utils'
import store from '@/store'
import DefaultLayout from '@/layouts/Default';
......@@ -43,6 +42,7 @@ describe('Homepage', function () {
afterEach(() => {
dispatchStub.restore()
wrapper.destroy()
})
describe('init values', () => {
it('should have a computed named layout', () => {
......@@ -51,8 +51,8 @@ describe('Homepage', function () {
})
it('should initialize locale with local storage', () => {
storage.set('locale', 'en')
const localeWrapper = mountApp(true)
expect(localeWrapper.vm.$i18n.locale).to.equal('en')
wrapper = mountApp(true)
expect(wrapper.vm.$i18n.locale).to.equal('en')
})
it('should be initialized with default locale', () => {
wrapper = mountApp()
......@@ -60,31 +60,13 @@ describe('Homepage', function () {
})
it('should initialize vuetify theme with local storage', () => {
storage.set('dark', 'true')
const themeWrapper = mountApp(true)
expect(themeWrapper.vm.$vuetify.theme.isDark).to.be.true
wrapper = mountApp(true)
expect(wrapper.vm.$vuetify.theme.isDark).to.be.true
})
it('should be initialized with default vuetify light theme', () => {
wrapper = mountApp()
expect(wrapper.vm.$vuetify.theme.isDark).to.equal(false, 'dark value')
})
describe('with active authority', () => {
let authStub, commitStub
beforeEach(() => {
authStub = sinon.stub(authority, 'isActive').value(true)
commitStub = sinon.stub(store, 'commit')
wrapper = mountApp(true)
})
afterEach(() => {
authStub.restore()
commitStub.restore()
})
it('should commit LOGIN', () => {
expect(commitStub.called).to.be.true
})
it('should load user\'s profile', () => {
expect(dispatchStub.called).to.be.true
})
})
})
describe('structure', function () {
beforeEach(() => {
......
......@@ -13,6 +13,9 @@ const mountLogin = (propsData = {}, shallow=false) =>
describe('login', () => {
let wrapper = {}
afterEach(() => {
wrapper.destroy()
})
describe('Component init', () => {
it('should compute a cancel route matching fromPath', () => {
wrapper = mountLogin({fromPath: '/back'}, true)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment