Test frontend, little try

This commit is contained in:
Wolfgang Huß 2021-06-16 08:06:56 +02:00
parent af5e255aad
commit 5a1eda272b

View File

@ -12,7 +12,7 @@ describe('donations.vue', () => {
$t: jest.fn((string) => string),
$apollo: {
// queries: {
// Donations: {
// Donations: {
// refetch: jest.fn(),
// // fetchMore: jest.fn().mockResolvedValue([
// // {
@ -23,14 +23,14 @@ describe('donations.vue', () => {
// // },
// // },
// // ]),
// },
// },
// },
query: jest.fn().mockResolvedValue({
data: {
Donations: 1,
},
}),
mutate: jest.fn(),
// query: jest.fn().mockResolvedValue({
// data: {
// Donations: 1,
// },
// }),
// mutate: jest.fn(),
},
}
})
@ -78,8 +78,10 @@ describe('donations.vue', () => {
})
describe('apollo', () => {
it.only('query is called', () => {
expect(mocks.$apollo.queries.Donations.refetch).toHaveBeenCalledTimes(1)
it.skip('query is called', () => {
// expect(mocks.$apollo.queries.Donations.refetch).toHaveBeenCalledTimes(1)
// expect(mocks.$apollo.Donations.query().exists()).toBeTruthy()
console.log('mocks.$apollo: ', mocks.$apollo)
})
it.skip('query result is displayed', () => {