updated tests
This commit is contained in:
parent
4831e7431b
commit
d9e53719bd
@ -31,6 +31,10 @@ class ServiceOfServices {
|
|||||||
this.store.dispatch('services/changeSelectedService', service)
|
this.store.dispatch('services/changeSelectedService', service)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async getSelectedService() {
|
||||||
|
return this.store.getters['services/selectedService']
|
||||||
|
}
|
||||||
|
|
||||||
async cancelSelectedService(id) {
|
async cancelSelectedService(id) {
|
||||||
const services = this.store.getters['services/services']
|
const services = this.store.getters['services/services']
|
||||||
const updatedServices = id === -1 ? removedNewService(services) : null
|
const updatedServices = id === -1 ? removedNewService(services) : null
|
||||||
|
|||||||
@ -58,7 +58,7 @@ describe('tests for ServiceOfServices', () => {
|
|||||||
test('test of fetchServicesList', async () => {
|
test('test of fetchServicesList', async () => {
|
||||||
const serviceOfServices = new ServiceOfServices(adapterOfServices, store)
|
const serviceOfServices = new ServiceOfServices(adapterOfServices, store)
|
||||||
|
|
||||||
await serviceOfServices.fetchServicesList()
|
await serviceOfServices.fetchServices()
|
||||||
|
|
||||||
const usersList = store.getters['services/servicesList']
|
const usersList = store.getters['services/servicesList']
|
||||||
|
|
||||||
|
|||||||
@ -57,7 +57,7 @@ describe("tests App mounted with vuex", () => {
|
|||||||
"is_active": true
|
"is_active": true
|
||||||
}])
|
}])
|
||||||
expect(componentState).toEqual('active')
|
expect(componentState).toEqual('active')
|
||||||
expect(selectedService).not.toBe(null)
|
expect(selectedService).toBe(null)
|
||||||
expect(answer).toBe("ok")
|
expect(answer).toBe("ok")
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user