@shopbite-de/storefront 1.23.3 → 1.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.example +22 -0
- package/.github/workflows/build.yaml +1 -1
- package/.github/workflows/ci.yaml +6 -3
- package/CLAUDE.md +48 -3
- package/README.md +139 -40
- package/api-gen.config.json +9 -0
- package/api-types/storeApiSchema.shopbite.overrides.json +35 -0
- package/api-types/storeApiTypes.d.ts +95 -81
- package/app/app.config.ts +3 -2
- package/app/app.vue +40 -53
- package/app/assets/css/main.css +36 -4
- package/app/components/AddToWishlist.vue +13 -6
- package/app/components/Address/Fields.vue +2 -21
- package/app/components/AnimatedSection.vue +9 -4
- package/app/components/BottomNavi.vue +9 -2
- package/app/components/Cart/Bar.vue +102 -0
- package/app/components/Cart/Item.vue +21 -10
- package/app/components/Cart/QuickView.vue +4 -0
- package/app/components/Cart/Upsell.vue +106 -0
- package/app/components/Category/Header.vue +9 -3
- package/app/components/Category/Listing.vue +62 -45
- package/app/components/Checkout/PaymentAndDelivery.vue +19 -3
- package/app/components/Checkout/Summary.vue +70 -2
- package/app/components/Cta.vue +4 -2
- package/app/components/DemoBanner.vue +13 -0
- package/app/components/Feature/Card.vue +121 -0
- package/app/components/Features.vue +14 -9
- package/app/components/Food/MarqueeItem.vue +20 -8
- package/app/components/Footer/Contact.vue +82 -0
- package/app/components/Footer/StoreStatus.vue +30 -0
- package/app/components/Footer.vue +2 -1
- package/app/components/Header/Body.vue +1 -1
- package/app/components/Header/Right.vue +60 -17
- package/app/components/Header/Title.vue +1 -0
- package/app/components/Header.vue +5 -15
- package/app/components/Hero.vue +169 -36
- package/app/components/ImageGallery.vue +11 -5
- package/app/components/Product/Card.vue +104 -46
- package/app/components/Product/CardCompact.vue +72 -0
- package/app/components/Product/CardDietBadges.vue +38 -31
- package/app/components/Product/CardIngredients.vue +35 -0
- package/app/components/Product/CardSkeleton.vue +10 -18
- package/app/components/Product/Category.vue +9 -2
- package/app/components/Product/Configurator.vue +11 -7
- package/app/components/Product/CrossSelling.vue +45 -34
- package/app/components/Product/DeselectIngredient.vue +37 -31
- package/app/components/Product/Detail.vue +73 -13
- package/app/components/Product/QuickView.vue +77 -0
- package/app/components/Topseller.vue +44 -34
- package/app/components/User/RegistrationForm.vue +0 -1
- package/app/components/Wishlist.vue +2 -15
- package/app/composables/useAddToCart.ts +13 -40
- package/app/composables/useAddressAutocomplete.ts +12 -19
- package/app/composables/useAddressSuggestionArea.ts +16 -0
- package/app/composables/useAddressValidation.ts +3 -19
- package/app/composables/useCartMutations.ts +168 -0
- package/app/composables/useCartQuickView.ts +19 -0
- package/app/composables/useCartUpsell.ts +100 -0
- package/app/composables/{useCategory.ts → useCategoryById.ts} +1 -1
- package/app/composables/useCategorySeo.ts +27 -29
- package/app/composables/useCheckoutMethodGuard.ts +201 -0
- package/app/composables/useMatomo.ts +25 -0
- package/app/composables/useMatomoConfig.ts +12 -0
- package/app/composables/useMenuSectionSchema.ts +55 -0
- package/app/composables/useNavigation.ts +12 -9
- package/app/composables/usePageSeo.ts +50 -0
- package/app/composables/useProductCartQuantity.ts +15 -0
- package/app/composables/useProductCrossSelling.ts +1 -0
- package/app/composables/useProductDetail.ts +15 -1
- package/app/composables/useProductEvents.ts +30 -0
- package/app/composables/useProductQuickView.ts +65 -0
- package/app/composables/useRestaurantSchema.ts +64 -0
- package/app/composables/useScrollAnimation.ts +39 -8
- package/app/composables/useSearchTracking.ts +33 -0
- package/app/composables/useSeoUrlRoute.ts +58 -0
- package/app/composables/useSortingSelection.ts +28 -0
- package/app/composables/useStoreStatus.ts +48 -0
- package/app/composables/useTopSellers.ts +22 -0
- package/app/composables/useTrackEvent.ts +36 -23
- package/app/pages/[...all].vue +4 -4
- package/app/pages/account/recover/password/index.vue +1 -0
- package/app/pages/anmelden.vue +4 -0
- package/app/pages/bestellung/[id]/erfolg.vue +1 -5
- package/app/pages/bestellung/[id]/fehler.vue +2 -2
- package/app/pages/bestellung/[id]/index.vue +9 -3
- package/app/pages/bestellung/bestaetigen.vue +1 -5
- package/app/pages/bestellung/warenkorb.vue +1 -5
- package/app/pages/bestellung/zahlung-versand.vue +1 -5
- package/app/pages/c/[...all].vue +2 -35
- package/app/pages/index.vue +28 -14
- package/app/pages/kontakt.vue +4 -0
- package/app/pages/konto/adressen.vue +4 -0
- package/app/pages/konto/bestellung/[id].vue +4 -0
- package/app/pages/konto/bestellungen.vue +4 -0
- package/app/pages/konto/index.vue +4 -0
- package/app/pages/konto/profil.vue +4 -0
- package/app/pages/maintenance.vue +6 -0
- package/app/pages/merkliste.vue +1 -7
- package/app/pages/passwort-vergessen.vue +1 -0
- package/app/pages/registrierung/bestaetigen.vue +4 -0
- package/app/pages/registrierung/index.vue +4 -0
- package/app/pages/speisekarte/[...all].vue +2 -36
- package/app/pages/suche.vue +42 -26
- package/app/plugins/matomo.ts +35 -0
- package/app/types/Association.d.ts +1 -0
- package/app/utils/hydrateWhenVisible.ts +20 -0
- package/app/utils/media.ts +33 -0
- package/app/utils/openingHours.ts +90 -0
- package/app/utils/product.ts +31 -0
- package/app/utils/schema.ts +235 -0
- package/app/utils/seo.ts +56 -0
- package/app/utils/seoPath.ts +57 -0
- package/content/index.yml +26 -20
- package/content.config.ts +16 -0
- package/docs/notes/2026-07-05-issue-259-matomo-broken.md +7 -0
- package/docs/notes/2026-09-08-issue-240-shipping-method-blocked.md +83 -0
- package/docs/notes/2026-09-08-issue-241-cart-lock-conflicts.md +63 -0
- package/docs/notes/2026-09-08-issue-244-category-url-trailing-slash.md +65 -0
- package/docs/notes/2026-09-08-issue-276-payment-method-blocked.md +39 -0
- package/docs/notes/2026-09-08-issue-277-typecheck.md +99 -0
- package/docs/notes/2026-09-10-issue-250-animated-section.md +23 -0
- package/docs/notes/2026-09-10-issue-251-shop-data-in-base-layer.md +30 -0
- package/docs/notes/2026-09-10-issue-272-restaurant-schema.md +27 -0
- package/docs/notes/2026-09-10-issue-273-performance-media.md +64 -0
- package/docs/notes/2026-09-10-issue-274-seo-basics.md +49 -0
- package/docs/notes/2026-09-10-issue-275-accessibility.md +46 -0
- package/docs/notes/2026-09-10-issue-290-footer-nap.md +28 -0
- package/docs/notes/2026-09-10-issue-291-seo-url-trailing-slash.md +24 -0
- package/docs/notes/2026-09-10-issue-294-matomo-without-config.md +33 -0
- package/docs/notes/2026-09-10-issue-295-search-hydration-mismatch.md +25 -0
- package/docs/notes/2026-09-10-issue-296-track-direct-search.md +19 -0
- package/docs/notes/2026-09-10-issue-312-store-api-criteria-post.md +64 -0
- package/docs/notes/2026-09-10-issue-313-wishlist-scoped-tailwind.md +29 -0
- package/docs/notes/2026-09-10-issue-314-mobile-js-cost.md +119 -0
- package/docs/notes/2026-09-12-issue-319-stylesheet-cost.md +154 -0
- package/docs/notes/2026-09-12-issue-325-product-card.md +100 -0
- package/docs/notes/2026-09-12-issue-327-home-hero.md +64 -0
- package/docs/notes/2026-09-13-demo-banner.md +32 -0
- package/docs/notes/2026-09-13-issue-332-home-info-cards.md +46 -0
- package/docs/notes/2026-09-13-quick-view-flicker.md +65 -0
- package/docs/notes/2026-09-14-cart-upsell.md +105 -0
- package/docs/notes/2026-09-14-demo-noindex.md +57 -0
- package/node.dockerfile +5 -2
- package/nuxt.config.ts +98 -15
- package/package.json +5 -3
- package/patches/@shopware__nuxt-module@1.5.1.patch +32 -0
- package/pnpm-workspace.yaml +2 -0
- package/public/hero-poster.webp +0 -0
- package/scripts/perf/first-render.mjs +30 -0
- package/scripts/perf/h2-proxy.cjs +49 -0
- package/scripts/perf/lighthouse.sh +22 -0
- package/scripts/perf/quick-view-layout.mjs +126 -0
- package/server/api/__sitemap__/urls.get.ts +49 -0
- package/server/api/category/[categoryId].get.ts +20 -9
- package/server/api/content/home.get.ts +14 -0
- package/server/api/content/page.get.ts +22 -0
- package/server/api/listing/[categoryId].get.ts +14 -18
- package/server/api/product/[productId]/cross-selling.get.ts +3 -9
- package/server/api/product/[productId].get.ts +4 -8
- package/server/api/search.get.ts +2 -0
- package/server/plugins/site-url.ts +13 -0
- package/server/plugins/sitemap-trailing-slash.ts +26 -0
- package/server/utils/sitemap.ts +60 -0
- package/server/utils/storeApi.ts +34 -0
- package/shopware.d.ts +35 -11
- package/test/e2e/simple-checkout-as-recurring-customer.test.ts +13 -17
- package/test/nuxt/AddressFields.test.ts +2 -73
- package/test/nuxt/AnimatedSection.test.ts +67 -0
- package/test/nuxt/CartBar.test.ts +110 -0
- package/test/nuxt/CartItem.test.ts +95 -0
- package/test/nuxt/CartUpsell.test.ts +125 -0
- package/test/nuxt/DemoBanner.test.ts +12 -0
- package/test/nuxt/FooterContact.test.ts +102 -0
- package/test/nuxt/FooterStoreStatus.test.ts +48 -0
- package/test/nuxt/HeaderRight.test.ts +14 -10
- package/test/nuxt/Hero.test.ts +68 -0
- package/test/nuxt/PaymentAndDelivery.test.ts +67 -8
- package/test/nuxt/RegistrationForm.test.ts +3 -0
- package/test/nuxt/useAddToCart.test.ts +37 -17
- package/test/nuxt/useAddressAutocomplete.test.ts +2 -38
- package/test/nuxt/useAddressSuggestionArea.test.ts +27 -0
- package/test/nuxt/useBusinessHours.test.ts +1 -1
- package/test/nuxt/useCartMutations.test.ts +225 -0
- package/test/nuxt/useCartUpsell.test.ts +126 -0
- package/test/nuxt/useCheckoutMethodGuard.test.ts +386 -0
- package/test/nuxt/useScrollAnimation.test.ts +55 -49
- package/test/nuxt/useSearchTracking.test.ts +71 -0
- package/test/nuxt/useSeoUrlRoute.test.ts +93 -0
- package/test/nuxt/useStoreStatus.test.ts +77 -0
- package/test/nuxt/useTrackEvent.test.ts +127 -0
- package/test/unit/media.spec.ts +49 -0
- package/test/unit/openingHours.spec.ts +90 -0
- package/test/unit/product.spec.ts +72 -0
- package/test/unit/schema.spec.ts +243 -0
- package/test/unit/seo.spec.ts +107 -0
- package/test/unit/seoPath.spec.ts +116 -0
- package/test/unit/sitemap.spec.ts +88 -0
- package/test/unit/useCategorySeo.spec.ts +42 -31
- package/test/unit/useSortingSelection.spec.ts +39 -0
- package/test/visual/playwright.config.ts +33 -0
- package/test/visual/visual.spec.ts +87 -0
- package/app/components/Product/CardDescription.vue +0 -27
- package/app/components/Product/CardFooter.vue +0 -51
- package/app/composables/useValidCitiesForDelivery.ts +0 -12
|
@@ -8,6 +8,15 @@ import { useHead, useSeoMeta } from "#imports";
|
|
|
8
8
|
const shared = vi.hoisted(() => ({
|
|
9
9
|
useHead: vi.fn(),
|
|
10
10
|
useSeoMeta: vi.fn(),
|
|
11
|
+
runtimeConfig: {
|
|
12
|
+
public: {
|
|
13
|
+
site: {
|
|
14
|
+
name: "My Store",
|
|
15
|
+
titleTemplate: "%s | %siteName – Online bestellen",
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
siteConfig: { url: "https://example.com" },
|
|
11
20
|
}));
|
|
12
21
|
|
|
13
22
|
// Mock Nuxt auto-imports via `#imports`
|
|
@@ -17,12 +26,8 @@ vi.mock("#imports", async () => {
|
|
|
17
26
|
// Expose mocks for inspection in tests
|
|
18
27
|
return {
|
|
19
28
|
...vue,
|
|
20
|
-
useRuntimeConfig: () =>
|
|
21
|
-
|
|
22
|
-
site: { name: "My Store" },
|
|
23
|
-
storeUrl: "https://example.com",
|
|
24
|
-
},
|
|
25
|
-
}),
|
|
29
|
+
useRuntimeConfig: () => shared.runtimeConfig,
|
|
30
|
+
useSiteConfig: () => shared.siteConfig,
|
|
26
31
|
useHead: shared.useHead,
|
|
27
32
|
useSeoMeta: shared.useSeoMeta,
|
|
28
33
|
};
|
|
@@ -33,23 +38,20 @@ vi.mock("#app", async () => {
|
|
|
33
38
|
const vue = await import("vue");
|
|
34
39
|
return {
|
|
35
40
|
...vue,
|
|
36
|
-
useRuntimeConfig: () =>
|
|
37
|
-
|
|
38
|
-
site: { name: "My Store" },
|
|
39
|
-
storeUrl: "https://example.com",
|
|
40
|
-
},
|
|
41
|
-
}),
|
|
41
|
+
useRuntimeConfig: () => shared.runtimeConfig,
|
|
42
|
+
useSiteConfig: () => shared.siteConfig,
|
|
42
43
|
useHead: shared.useHead,
|
|
43
44
|
useSeoMeta: shared.useSeoMeta,
|
|
44
45
|
};
|
|
45
46
|
});
|
|
46
47
|
|
|
47
48
|
// Target under test will be dynamically imported after setting up globals
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
type UseCategorySeo =
|
|
50
|
+
(typeof import("../../app/composables/useCategorySeo"))["useCategorySeo"];
|
|
51
|
+
let useCategorySeo: UseCategorySeo;
|
|
52
|
+
// The tests only need a partial category shape.
|
|
53
|
+
const asCategory = (category: unknown) =>
|
|
54
|
+
category as Parameters<UseCategorySeo>[0];
|
|
53
55
|
|
|
54
56
|
describe("useCategorySeo", () => {
|
|
55
57
|
beforeEach(async () => {
|
|
@@ -58,9 +60,10 @@ describe("useCategorySeo", () => {
|
|
|
58
60
|
const vue = await import("vue");
|
|
59
61
|
(globalThis as Record<string, unknown>).computed = vue.computed;
|
|
60
62
|
(globalThis as Record<string, unknown>).ref = vue.ref;
|
|
61
|
-
(globalThis as Record<string, unknown>).useRuntimeConfig = () =>
|
|
62
|
-
|
|
63
|
-
|
|
63
|
+
(globalThis as Record<string, unknown>).useRuntimeConfig = () =>
|
|
64
|
+
shared.runtimeConfig;
|
|
65
|
+
(globalThis as Record<string, unknown>).useSiteConfig = () =>
|
|
66
|
+
shared.siteConfig;
|
|
64
67
|
(globalThis as Record<string, unknown>).useHead = useHead;
|
|
65
68
|
(globalThis as Record<string, unknown>).useSeoMeta = useSeoMeta;
|
|
66
69
|
|
|
@@ -86,24 +89,32 @@ describe("useCategorySeo", () => {
|
|
|
86
89
|
metaDescription: "Leckere Pizza und Pasta bestellen",
|
|
87
90
|
breadcrumb: ["Speisen", "Italienisch", "Pasta"],
|
|
88
91
|
},
|
|
89
|
-
seoUrl: "/c/pasta",
|
|
92
|
+
seoUrl: "/c/pasta/",
|
|
90
93
|
active: true,
|
|
91
94
|
media: { url: "https://example.com/img/pasta.jpg" },
|
|
92
95
|
});
|
|
93
96
|
|
|
94
|
-
const result = useCategorySeo(category);
|
|
97
|
+
const result = useCategorySeo(asCategory(category));
|
|
95
98
|
|
|
96
|
-
// Returned refs
|
|
97
|
-
|
|
98
|
-
|
|
99
|
+
// Returned refs: the <title> template is applied globally, og/twitter
|
|
100
|
+
// titles carry it explicitly
|
|
101
|
+
expect(result.pageTitle.value).toBe("Pizza & Pasta");
|
|
102
|
+
expect(result.fullTitle.value).toBe(
|
|
103
|
+
"Pizza & Pasta | My Store – Online bestellen",
|
|
99
104
|
);
|
|
100
|
-
expect(result.canonicalUrl.value).toBe("https://example.com/c/pasta");
|
|
101
|
-
|
|
105
|
+
expect(result.canonicalUrl.value).toBe("https://example.com/c/pasta/");
|
|
106
|
+
// Active categories leave the robots rule to @nuxtjs/robots
|
|
107
|
+
expect(result.robots.value).toBeUndefined();
|
|
102
108
|
|
|
103
109
|
// useSeoMeta should be called once with expected keys
|
|
104
110
|
expect(
|
|
105
111
|
useSeoMeta as unknown as ReturnType<typeof vi.fn>,
|
|
106
112
|
).toHaveBeenCalledTimes(1);
|
|
113
|
+
const seoArg = (useSeoMeta as unknown as ReturnType<typeof vi.fn>).mock
|
|
114
|
+
.calls[0]![0]!;
|
|
115
|
+
expect(seoArg.ogTitle.value).toBe(
|
|
116
|
+
"Pizza & Pasta | My Store – Online bestellen",
|
|
117
|
+
);
|
|
107
118
|
|
|
108
119
|
// useHead should receive canonical link and JSON-LD scripts
|
|
109
120
|
expect(
|
|
@@ -112,11 +123,11 @@ describe("useCategorySeo", () => {
|
|
|
112
123
|
const headArg = (useHead as unknown as ReturnType<typeof vi.fn>).mock
|
|
113
124
|
.calls[0]![0]!;
|
|
114
125
|
|
|
115
|
-
// Canonical link
|
|
126
|
+
// Canonical link keeps the trailing slash of the SEO URL
|
|
116
127
|
const link = headArg.link?.[0];
|
|
117
128
|
expect(link).toMatchObject({
|
|
118
129
|
rel: "canonical",
|
|
119
|
-
href: "https://example.com/c/pasta",
|
|
130
|
+
href: "https://example.com/c/pasta/",
|
|
120
131
|
});
|
|
121
132
|
|
|
122
133
|
// JSON-LD scripts
|
|
@@ -125,7 +136,7 @@ describe("useCategorySeo", () => {
|
|
|
125
136
|
|
|
126
137
|
const collection = JSON.parse(scripts[0].innerHTML);
|
|
127
138
|
expect(collection["@type"]).toBe("CollectionPage");
|
|
128
|
-
expect(collection.url).toBe("https://example.com/c/pasta");
|
|
139
|
+
expect(collection.url).toBe("https://example.com/c/pasta/");
|
|
129
140
|
expect(collection.image?.[0]).toBe("https://example.com/img/pasta.jpg");
|
|
130
141
|
});
|
|
131
142
|
|
|
@@ -136,7 +147,7 @@ describe("useCategorySeo", () => {
|
|
|
136
147
|
seoUrl: "/c/salate",
|
|
137
148
|
});
|
|
138
149
|
|
|
139
|
-
const result = useCategorySeo(category);
|
|
150
|
+
const result = useCategorySeo(asCategory(category));
|
|
140
151
|
expect(result.robots.value).toBe("noindex,nofollow");
|
|
141
152
|
});
|
|
142
153
|
});
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { ref } from "vue";
|
|
3
|
+
import {
|
|
4
|
+
SORTING_PLACEHOLDER,
|
|
5
|
+
useSortingSelection,
|
|
6
|
+
} from "../../app/composables/useSortingSelection";
|
|
7
|
+
|
|
8
|
+
describe("useSortingSelection", () => {
|
|
9
|
+
it("shows the placeholder until the listing resolves, then follows it", () => {
|
|
10
|
+
const currentSortingOrder = ref<string | undefined>(undefined);
|
|
11
|
+
const { currentSorting } = useSortingSelection(currentSortingOrder);
|
|
12
|
+
|
|
13
|
+
expect(currentSorting.value).toBe(SORTING_PLACEHOLDER);
|
|
14
|
+
|
|
15
|
+
currentSortingOrder.value = "score";
|
|
16
|
+
expect(currentSorting.value).toBe("score");
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
it("renders the listing sorting when it is already present at setup", () => {
|
|
20
|
+
const { currentSorting } = useSortingSelection(ref("score"));
|
|
21
|
+
|
|
22
|
+
expect(currentSorting.value).toBe("score");
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it("keeps the user's choice until the placeholder resets it", () => {
|
|
26
|
+
const currentSortingOrder = ref<string | undefined>("score");
|
|
27
|
+
const { currentSorting } = useSortingSelection(currentSortingOrder);
|
|
28
|
+
|
|
29
|
+
currentSorting.value = "name-asc";
|
|
30
|
+
expect(currentSorting.value).toBe("name-asc");
|
|
31
|
+
|
|
32
|
+
// a later response reports another sorting, the choice wins
|
|
33
|
+
currentSortingOrder.value = "price-asc";
|
|
34
|
+
expect(currentSorting.value).toBe("name-asc");
|
|
35
|
+
|
|
36
|
+
currentSorting.value = SORTING_PLACEHOLDER;
|
|
37
|
+
expect(currentSorting.value).toBe("price-asc");
|
|
38
|
+
});
|
|
39
|
+
});
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { defineConfig } from "@playwright/test";
|
|
2
|
+
export default defineConfig({
|
|
3
|
+
testDir: ".",
|
|
4
|
+
outputDir: "./results",
|
|
5
|
+
snapshotPathTemplate: "{testDir}/__snapshots__/{projectName}/{arg}{ext}",
|
|
6
|
+
timeout: 90_000,
|
|
7
|
+
workers: 1,
|
|
8
|
+
retries: 0,
|
|
9
|
+
reporter: [["list"]],
|
|
10
|
+
use: {
|
|
11
|
+
baseURL: process.env.BASE_URL || "https://localhost:3443",
|
|
12
|
+
ignoreHTTPSErrors: true,
|
|
13
|
+
deviceScaleFactor: 1,
|
|
14
|
+
},
|
|
15
|
+
expect: {
|
|
16
|
+
toHaveScreenshot: {
|
|
17
|
+
maxDiffPixels: 0,
|
|
18
|
+
threshold: 0.01,
|
|
19
|
+
animations: "disabled",
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
projects: [
|
|
23
|
+
{
|
|
24
|
+
name: "mobile",
|
|
25
|
+
use: {
|
|
26
|
+
viewport: { width: 390, height: 844 },
|
|
27
|
+
isMobile: true,
|
|
28
|
+
hasTouch: true,
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
{ name: "desktop", use: { viewport: { width: 1280, height: 800 } } },
|
|
32
|
+
],
|
|
33
|
+
});
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
// Screenshot comparison of the pages the stylesheet work touches (#319).
|
|
2
|
+
// Run against the production build behind scripts/perf/h2-proxy.cjs:
|
|
3
|
+
// pnpm playwright test --config test/visual/playwright.config.ts --update-snapshots # baseline
|
|
4
|
+
// pnpm playwright test --config test/visual/playwright.config.ts # compare
|
|
5
|
+
import { test, expect, type Page } from "@playwright/test";
|
|
6
|
+
|
|
7
|
+
const modes = ["light", "dark"] as const;
|
|
8
|
+
|
|
9
|
+
async function settle(page: Page) {
|
|
10
|
+
// hydrate scroll-based sections and reveal AnimatedSection blocks
|
|
11
|
+
const h = await page.evaluate(() => document.body.scrollHeight);
|
|
12
|
+
for (let y = 0; y < h + 800; y += 500) {
|
|
13
|
+
await page.evaluate((y) => window.scrollTo(0, y), y);
|
|
14
|
+
await page.waitForTimeout(80);
|
|
15
|
+
}
|
|
16
|
+
await page.evaluate(() => window.scrollTo(0, 0));
|
|
17
|
+
await page.waitForTimeout(400);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
async function open(page: Page, path: string, mode: string) {
|
|
21
|
+
await page.addInitScript((m) => {
|
|
22
|
+
try {
|
|
23
|
+
localStorage.setItem("nuxt-color-mode", m);
|
|
24
|
+
} catch {
|
|
25
|
+
// storage can be unavailable in the sandboxed init script
|
|
26
|
+
}
|
|
27
|
+
}, mode);
|
|
28
|
+
await page.emulateMedia({ reducedMotion: "reduce" });
|
|
29
|
+
await page.goto(path, { waitUntil: "networkidle" });
|
|
30
|
+
await page.addStyleTag({
|
|
31
|
+
content:
|
|
32
|
+
"*,*::before,*::after{animation:none!important;transition:none!important;caret-color:transparent!important}",
|
|
33
|
+
});
|
|
34
|
+
await settle(page);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
for (const mode of modes) {
|
|
38
|
+
test.describe(mode, () => {
|
|
39
|
+
test("home", async ({ page }) => {
|
|
40
|
+
await open(page, "/", mode);
|
|
41
|
+
await expect(page).toHaveScreenshot(`home-${mode}.png`, {
|
|
42
|
+
fullPage: true,
|
|
43
|
+
});
|
|
44
|
+
await expect(page.locator("footer").first()).toHaveScreenshot(
|
|
45
|
+
`footer-${mode}.png`,
|
|
46
|
+
);
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
test("category", async ({ page }) => {
|
|
50
|
+
await open(page, "/c/Pizza/", mode);
|
|
51
|
+
await expect(page).toHaveScreenshot(`category-${mode}.png`, {
|
|
52
|
+
fullPage: true,
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
test("cart drawer and checkout", async ({ page }) => {
|
|
57
|
+
await open(page, "/c/Pizza/", mode);
|
|
58
|
+
const card = page.locator('[id^="product-card-"]').first();
|
|
59
|
+
await card.scrollIntoViewIfNeeded();
|
|
60
|
+
await card.locator("button .i-lucide\\:shopping-cart").click();
|
|
61
|
+
const add = page.getByRole("button", { name: "In den Warenkorb" });
|
|
62
|
+
await expect(add).toBeVisible({ timeout: 10000 });
|
|
63
|
+
await page.waitForTimeout(300);
|
|
64
|
+
await expect(page).toHaveScreenshot(`card-options-${mode}.png`);
|
|
65
|
+
await add.click();
|
|
66
|
+
await expect(add).not.toBeVisible({ timeout: 10000 });
|
|
67
|
+
await page
|
|
68
|
+
.locator("button .i-lucide\\:shopping-bag")
|
|
69
|
+
.locator("..")
|
|
70
|
+
.first()
|
|
71
|
+
.click();
|
|
72
|
+
const drawer = page.locator('[data-vaul-drawer][data-state="open"]');
|
|
73
|
+
await expect(drawer).toBeVisible({ timeout: 10000 });
|
|
74
|
+
await page.waitForTimeout(800);
|
|
75
|
+
await expect(page).toHaveScreenshot(`cart-drawer-${mode}.png`);
|
|
76
|
+
await page.goto("/bestellung/warenkorb", { waitUntil: "networkidle" });
|
|
77
|
+
await page.addStyleTag({
|
|
78
|
+
content:
|
|
79
|
+
"*,*::before,*::after{animation:none!important;transition:none!important;caret-color:transparent!important}",
|
|
80
|
+
});
|
|
81
|
+
await settle(page);
|
|
82
|
+
await expect(page).toHaveScreenshot(`checkout-${mode}.png`, {
|
|
83
|
+
fullPage: true,
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import type { Schemas } from "#shopware";
|
|
3
|
-
|
|
4
|
-
const props = defineProps<{
|
|
5
|
-
description: string | null | undefined;
|
|
6
|
-
sortedProperties: Schemas["PropertyGroup"][] | undefined;
|
|
7
|
-
}>();
|
|
8
|
-
|
|
9
|
-
const mainIngredients = computed<Schemas["PropertyGroupOption"][]>(() => {
|
|
10
|
-
const group = props.sortedProperties?.find(
|
|
11
|
-
(propertyGroup) => propertyGroup.translated.name === "Hauptzutaten",
|
|
12
|
-
);
|
|
13
|
-
return group?.options ?? [];
|
|
14
|
-
});
|
|
15
|
-
</script>
|
|
16
|
-
|
|
17
|
-
<template>
|
|
18
|
-
<div class="flex flex-col gap-2">
|
|
19
|
-
<div>{{ description }}</div>
|
|
20
|
-
<div
|
|
21
|
-
v-if="mainIngredients.length > 0"
|
|
22
|
-
class="font-extralight text-sm text-pretty"
|
|
23
|
-
>
|
|
24
|
-
{{ mainIngredients.map((i) => i.translated.name).join(", ") }}
|
|
25
|
-
</div>
|
|
26
|
-
</div>
|
|
27
|
-
</template>
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import type { Schemas } from "#shopware";
|
|
3
|
-
|
|
4
|
-
defineProps<{
|
|
5
|
-
price: number;
|
|
6
|
-
product: Schemas["Product"];
|
|
7
|
-
withFavoriteButton: boolean;
|
|
8
|
-
withAddToCartButton: boolean;
|
|
9
|
-
}>();
|
|
10
|
-
|
|
11
|
-
const emit = defineEmits<{
|
|
12
|
-
variantSelected: [variant: Schemas["Product"]];
|
|
13
|
-
}>();
|
|
14
|
-
|
|
15
|
-
const { isCheckoutEnabled } = useShopBiteConfig();
|
|
16
|
-
|
|
17
|
-
const { getFormattedPrice } = useCommercePrice();
|
|
18
|
-
|
|
19
|
-
const openDetails = ref(false);
|
|
20
|
-
|
|
21
|
-
function toggleDetails() {
|
|
22
|
-
openDetails.value = !openDetails.value;
|
|
23
|
-
}
|
|
24
|
-
</script>
|
|
25
|
-
|
|
26
|
-
<template>
|
|
27
|
-
<div class="flex flex-row justify-between content-center w-full">
|
|
28
|
-
<p>{{ getFormattedPrice(price) }}</p>
|
|
29
|
-
<div class="flex flex-row gap-2">
|
|
30
|
-
<AddToWishlist v-if="withFavoriteButton" :product="product" />
|
|
31
|
-
<UButton
|
|
32
|
-
v-if="withAddToCartButton && isCheckoutEnabled"
|
|
33
|
-
icon="i-lucide-shopping-cart"
|
|
34
|
-
variant="subtle"
|
|
35
|
-
aria-label="Öffnet Produkt-Optionen"
|
|
36
|
-
@click="toggleDetails"
|
|
37
|
-
/>
|
|
38
|
-
</div>
|
|
39
|
-
</div>
|
|
40
|
-
<ClientOnly>
|
|
41
|
-
<UCollapsible v-model:open="openDetails" class="flex flex-col gap-2">
|
|
42
|
-
<template #content>
|
|
43
|
-
<LazyProductDetail
|
|
44
|
-
:product-id="product.id"
|
|
45
|
-
@product-added="toggleDetails"
|
|
46
|
-
@variant-selected="emit('variantSelected', $event)"
|
|
47
|
-
/>
|
|
48
|
-
</template>
|
|
49
|
-
</UCollapsible>
|
|
50
|
-
</ClientOnly>
|
|
51
|
-
</template>
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export function useValidCitiesForDelivery() {
|
|
2
|
-
const validCities = computed(() => ["Obertshausen", "Lämmerspiel", "Hausen"]);
|
|
3
|
-
|
|
4
|
-
const boundingBoxCoordinates = computed(
|
|
5
|
-
() => "8.822251,50.055026,8.899077,50.104327",
|
|
6
|
-
);
|
|
7
|
-
|
|
8
|
-
return {
|
|
9
|
-
validCities,
|
|
10
|
-
boundingBoxCoordinates,
|
|
11
|
-
};
|
|
12
|
-
}
|