Formatting

This commit is contained in:
scottkiener-at-safelite 2026-05-28 12:30:19 -04:00
parent 85b8789bca
commit 890f50c18e

View file

@ -10,7 +10,13 @@ function mountDesktop(props = {}) {
value: 1024,
});
return shallowMount(datePicker, {
props: { availableDates: AVAILABLE_DATES, startDate: "2026-01-21", endDate: "2026-01-25", modelValue: null, ...props },
props: {
availableDates: AVAILABLE_DATES,
startDate: "2026-01-21",
endDate: "2026-01-25",
modelValue: null,
...props,
},
});
}
@ -21,7 +27,13 @@ function mountMobile(props = {}) {
value: 375,
});
return shallowMount(datePicker, {
props: { availableDates: AVAILABLE_DATES, startDate: "2026-01-21", endDate: "2026-01-25", modelValue: null, ...props },
props: {
availableDates: AVAILABLE_DATES,
startDate: "2026-01-21",
endDate: "2026-01-25",
modelValue: null,
...props,
},
});
}
@ -145,7 +157,11 @@ describe("date-picker.vue", () => {
test("goForward advances windowStart by the window size", async () => {
// Use a longer range so forward is possible on desktop (window 5)
const manyDates = ["2026-01-01", "2026-01-02", "2026-01-03", "2026-01-10"];
const wrapper = mountDesktop({ availableDates: manyDates, startDate: "2026-01-01", endDate: "2026-01-10" });
const wrapper = mountDesktop({
availableDates: manyDates,
startDate: "2026-01-01",
endDate: "2026-01-10",
});
expect(wrapper.vm.canGoForward).toBe(true);
await wrapper.vm.goForward();
expect(wrapper.vm.windowStart).toBe(5);
@ -154,7 +170,11 @@ describe("date-picker.vue", () => {
test("goBack decrements windowStart by the window size", async () => {
const manyDates = ["2026-01-01", "2026-01-02", "2026-01-03", "2026-01-10"];
const wrapper = mountDesktop({ availableDates: manyDates, startDate: "2026-01-01", endDate: "2026-01-10" });
const wrapper = mountDesktop({
availableDates: manyDates,
startDate: "2026-01-01",
endDate: "2026-01-10",
});
await wrapper.vm.goForward();
await wrapper.vm.goBack();
expect(wrapper.vm.windowStart).toBe(0);
@ -181,7 +201,11 @@ describe("date-picker.vue", () => {
test("back button becomes enabled after navigating forward", async () => {
const manyDates = ["2026-01-01", "2026-01-02", "2026-01-03", "2026-01-10"];
const wrapper = mountDesktop({ availableDates: manyDates, startDate: "2026-01-01", endDate: "2026-01-10" });
const wrapper = mountDesktop({
availableDates: manyDates,
startDate: "2026-01-01",
endDate: "2026-01-10",
});
await wrapper.vm.goForward();
await wrapper.vm.$nextTick();
const backBtn = wrapper.findAll(".date-picker__nav-btn")[0];