This commit is contained in:
parent
8e4a92b6be
commit
76968fe6bd
|
@ -62,12 +62,14 @@ describe('CardSummary', () => {
|
|||
});
|
||||
|
||||
it('should respond to prop changes and refetch data', async () => {
|
||||
const newUrl = 'CardSummary/35';
|
||||
const newKey = 'cardSummaryKey/35';
|
||||
const fetchSpy = vi.spyOn(vm.arrayData, 'fetch');
|
||||
await wrapper.setProps({ url: 'newUrl', filter: { key: 'newValue' } });
|
||||
await wrapper.setProps({ url: newUrl, filter: { key: newKey } });
|
||||
|
||||
expect(fetchSpy).toHaveBeenCalled();
|
||||
expect(vm.store.url).toBe('newUrl');
|
||||
expect(vm.store.filter).toEqual({ key: 'newValue' });
|
||||
expect(vm.store.url).toBe(newUrl);
|
||||
expect(vm.store.filter).toEqual({ key: newKey });
|
||||
});
|
||||
|
||||
it('should return true if route path ends with /summary' , () => {
|
||||
|
|
Loading…
Reference in New Issue