diff --git a/src/layouts/scheduling/inshop-scheduling-card/inshop-scheduling-card.spec.js b/src/layouts/scheduling/inshop-scheduling-card/inshop-scheduling-card.spec.js index bfbade779..09647f4ca 100644 --- a/src/layouts/scheduling/inshop-scheduling-card/inshop-scheduling-card.spec.js +++ b/src/layouts/scheduling/inshop-scheduling-card/inshop-scheduling-card.spec.js @@ -243,4 +243,27 @@ describe("inshop-scheduling-card.vue", () => { expect(wrapper.find(".inshop-scheduling-card__body").isVisible()).toBe(false); wrapper.unmount(); }); + + describe("isLoading prop", () => { + test("shows the skeleton loader and hides real content when isLoading is true", () => { + const wrapper = mountComponent({ isLoading: true }); + expect(wrapper.find("scheduling-card-loader-stub").exists()).toBe(true); + expect(wrapper.find(".inshop-scheduling-card__header").exists()).toBe(false); + wrapper.unmount(); + }); + + test("hides the skeleton loader and shows real content when isLoading is false", () => { + const wrapper = mountComponent({ isLoading: false }); + expect(wrapper.find("scheduling-card-loader-stub").exists()).toBe(false); + expect(wrapper.find(".inshop-scheduling-card__header").exists()).toBe(true); + wrapper.unmount(); + }); + + test("defaults isLoading to false", () => { + const wrapper = mountComponent(); + expect(wrapper.props("isLoading")).toBe(false); + expect(wrapper.find("scheduling-card-loader-stub").exists()).toBe(false); + wrapper.unmount(); + }); + }); }); diff --git a/src/layouts/scheduling/inshop-scheduling-card/inshop-scheduling-card.vue b/src/layouts/scheduling/inshop-scheduling-card/inshop-scheduling-card.vue index 23638d9e0..a701ab54c 100644 --- a/src/layouts/scheduling/inshop-scheduling-card/inshop-scheduling-card.vue +++ b/src/layouts/scheduling/inshop-scheduling-card/inshop-scheduling-card.vue @@ -1,6 +1,9 @@