UNCLASSIFIED

Commit edba2098 authored by hunter.congress's avatar hunter.congress
Browse files

adjusted positioning and font

parent bdc5cc6c
...@@ -455,6 +455,7 @@ describe("TrainingAttendance", () => { ...@@ -455,6 +455,7 @@ describe("TrainingAttendance", () => {
}); });
expect(wrapper.vm.$store.commit).toHaveBeenCalledTimes(1); expect(wrapper.vm.$store.commit).toHaveBeenCalledTimes(1);
}); });
it("should call fetchDebounced when options change", async () => { it("should call fetchDebounced when options change", async () => {
TrainingService.getCourseRegistrationsById = jest TrainingService.getCourseRegistrationsById = jest
.fn() .fn()
...@@ -483,72 +484,6 @@ describe("TrainingAttendance", () => { ...@@ -483,72 +484,6 @@ describe("TrainingAttendance", () => {
wrapper.vm.fetchDebounced = jest.fn(); wrapper.vm.fetchDebounced = jest.fn();
// trigger the watch for wrapper.vm.options // trigger the watch for wrapper.vm.options
const mockOptions = { itemsPerPage: 46 };
wrapper.vm.options = mockOptions;
await wrapper.vm.$nextTick();
expect(wrapper.vm.fetchDebounced).toHaveBeenCalledTimes(1);
expect(wrapper.vm.params.pageSize).toEqual(mockOptions.itemsPerPage);
});
it("should not call fetchDebounced if options don't change", async () => {
TrainingService.getCourseRegistrationsById = jest
.fn()
.mockResolvedValue({ registrations: [] });
const wrapper = shallowMount(TrainingAttendance, {
mocks: {
$store: {
state: {
error: {},
},
commit: jest.fn(),
},
},
propsData,
localVue,
vuetify,
});
await flushPromises();
wrapper.vm.fetchDebounced = jest.fn();
// trigger the watch for wrapper.vm.options
wrapper.vm.options = { ...wrapper.vm.options };
await wrapper.vm.$nextTick();
// since the old and new options are equal, fetchDebounced should not hae been called
expect(wrapper.vm.fetchDebounced).toHaveBeenCalledTimes(0);
});
it("should call fetchDebounced when reload changes", async () => {
TrainingService.getCourseRegistrationsById = jest
.fn()
.mockResolvedValue({ registrations: [] });
const wrapper = shallowMount(TrainingAttendance, {
mocks: {
$store: {
state: {
error: {},
},
commit: jest.fn(),
},
},
data() {
return {
selectedUsers: [{ userId: 1 }, { userId: 2 }],
listItems: [{ userId: 1 }, { userId: 2 }, { userId: 3 }],
};
},
propsData: { ...propsData, reload: 0 },
localVue,
vuetify,
});
await flushPromises();
wrapper.vm.fetchDebounced = jest.fn();
const mockOptions = 2;
wrapper.vm.reload = mockOptions;
await wrapper.vm.$nextTick();
await wrapper.setProps({ reload: 1 }); await wrapper.setProps({ reload: 1 });
expect(wrapper.vm.fetchDebounced).toHaveBeenCalledTimes(1); expect(wrapper.vm.fetchDebounced).toHaveBeenCalledTimes(1);
}); });
...@@ -678,3 +613,5 @@ describe("TrainingAttendance", () => { ...@@ -678,3 +613,5 @@ describe("TrainingAttendance", () => {
}); });
}); });
Markdown is supported
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