Mock app, nodeInfo and settings api in tests

This commit is contained in:
Angelina Filippova 2020-10-12 23:39:12 +03:00
parent 4eed4d0138
commit fedb634c48
12 changed files with 27 additions and 6 deletions

View file

@ -15,6 +15,7 @@ localVue.use(Element)
jest.mock('@/api/app') jest.mock('@/api/app')
jest.mock('@/api/invites') jest.mock('@/api/invites')
jest.mock('@/api/nodeInfo') jest.mock('@/api/nodeInfo')
jest.mock('@/api/settings')
describe('Invite tokens', () => { describe('Invite tokens', () => {
let store let store

View file

@ -16,8 +16,10 @@ localVue.use(Vuex)
localVue.use(VueRouter) localVue.use(VueRouter)
localVue.use(Element) localVue.use(Element)
jest.mock('@/api/app')
jest.mock('@/api/nodeInfo') jest.mock('@/api/nodeInfo')
jest.mock('@/api/login') jest.mock('@/api/login')
jest.mock('@/api/settings')
describe('Login', () => { describe('Login', () => {
let store let store

View file

@ -15,6 +15,7 @@ localVue.use(Vuex)
localVue.use(Element) localVue.use(Element)
jest.mock('@/api/app') jest.mock('@/api/app')
jest.mock('@/api/nodeInfo')
jest.mock('@/api/reports') jest.mock('@/api/reports')
jest.mock('@/api/settings') jest.mock('@/api/settings')

View file

@ -12,7 +12,10 @@ const localVue = createLocalVue()
localVue.use(Vuex) localVue.use(Vuex)
localVue.use(Element) localVue.use(Element)
jest.mock('@/api/app')
jest.mock('@/api/nodeInfo')
jest.mock('@/api/reports') jest.mock('@/api/reports')
jest.mock('@/api/settings')
describe('Report in a timeline', () => { describe('Report in a timeline', () => {
let store let store

View file

@ -12,7 +12,10 @@ const localVue = createLocalVue()
localVue.use(Vuex) localVue.use(Vuex)
localVue.use(Element) localVue.use(Element)
jest.mock('@/api/app')
jest.mock('@/api/nodeInfo')
jest.mock('@/api/reports') jest.mock('@/api/reports')
jest.mock('@/api/settings')
describe('Reports filter', () => { describe('Reports filter', () => {
let store let store

View file

@ -12,7 +12,10 @@ const localVue = createLocalVue()
localVue.use(Vuex) localVue.use(Vuex)
localVue.use(Element) localVue.use(Element)
jest.mock('@/api/app')
jest.mock('@/api/nodeInfo')
jest.mock('@/api/reports') jest.mock('@/api/reports')
jest.mock('@/api/settings')
jest.mock('@/api/status') jest.mock('@/api/status')
describe('Status in reports', () => { describe('Status in reports', () => {

View file

@ -14,9 +14,10 @@ localVue.use(Vuex)
localVue.use(Element) localVue.use(Element)
jest.mock('@/api/app') jest.mock('@/api/app')
jest.mock('@/api/status')
jest.mock('@/api/peers')
jest.mock('@/api/nodeInfo') jest.mock('@/api/nodeInfo')
jest.mock('@/api/peers')
jest.mock('@/api/settings')
jest.mock('@/api/status')
describe('Statuses', () => { describe('Statuses', () => {
let store let store

View file

@ -14,9 +14,10 @@ localVue.use(Vuex)
localVue.use(Element) localVue.use(Element)
jest.mock('@/api/app') jest.mock('@/api/app')
jest.mock('@/api/status')
jest.mock('@/api/peers')
jest.mock('@/api/nodeInfo') jest.mock('@/api/nodeInfo')
jest.mock('@/api/peers')
jest.mock('@/api/settings')
jest.mock('@/api/status')
describe('Statuses', () => { describe('Statuses', () => {
let store let store

View file

@ -20,9 +20,10 @@ const $route = {
} }
jest.mock('@/api/app') jest.mock('@/api/app')
jest.mock('@/api/status')
jest.mock('@/api/peers')
jest.mock('@/api/nodeInfo') jest.mock('@/api/nodeInfo')
jest.mock('@/api/peers')
jest.mock('@/api/settings')
jest.mock('@/api/status')
jest.mock('@/api/users') jest.mock('@/api/users')
describe('Status show page', () => { describe('Status show page', () => {

View file

@ -13,7 +13,9 @@ const localVue = createLocalVue()
localVue.use(Vuex) localVue.use(Vuex)
localVue.use(Element) localVue.use(Element)
jest.mock('@/api/app')
jest.mock('@/api/nodeInfo') jest.mock('@/api/nodeInfo')
jest.mock('@/api/settings')
jest.mock('@/api/users') jest.mock('@/api/users')
describe('Apply users actions to multiple users', () => { describe('Apply users actions to multiple users', () => {

View file

@ -22,6 +22,7 @@ const $route = {
jest.mock('@/api/app') jest.mock('@/api/app')
jest.mock('@/api/nodeInfo') jest.mock('@/api/nodeInfo')
jest.mock('@/api/users') jest.mock('@/api/users')
jest.mock('@/api/settings')
describe('User profile', () => { describe('User profile', () => {
let store let store

View file

@ -13,7 +13,9 @@ const localVue = createLocalVue()
localVue.use(Vuex) localVue.use(Vuex)
localVue.use(Element) localVue.use(Element)
jest.mock('@/api/app')
jest.mock('@/api/nodeInfo') jest.mock('@/api/nodeInfo')
jest.mock('@/api/settings')
jest.mock('@/api/users') jest.mock('@/api/users')
describe('Filters users', () => { describe('Filters users', () => {