@shopbite-de/storefront 1.31.3 → 2.0.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/.github/workflows/ci.yaml +54 -0
- package/CLAUDE.md +23 -8
- package/app/app.vue +10 -6
- package/app/assets/css/main.css +100 -61
- package/app/components/AddToWishlist.vue +15 -25
- package/app/components/Address/Card.vue +6 -11
- package/app/components/Address/Detail.vue +23 -23
- package/app/components/Address/Fields.vue +175 -73
- package/app/components/Address/Form.vue +107 -106
- package/app/components/Cart/Bar.vue +6 -9
- package/app/components/Cart/Item.vue +48 -63
- package/app/components/Cart/QuickView.vue +38 -25
- package/app/components/Cart/Upsell.vue +24 -62
- package/app/components/Category/Breadcrumb.vue +29 -3
- package/app/components/Category/FilterGroup.vue +20 -41
- package/app/components/Category/Listing.vue +100 -130
- package/app/components/Category/SearchInput.vue +22 -19
- package/app/components/Checkout/DeliveryTimeSelect.vue +55 -77
- package/app/components/Checkout/LoginOrRegister.vue +28 -29
- package/app/components/Checkout/PaymentAndDelivery.vue +114 -86
- package/app/components/Checkout/Summary.vue +90 -60
- package/app/components/Checkout/VoucherInput.vue +40 -27
- package/app/components/Contact/Form.vue +164 -192
- package/app/components/DemoBanner.vue +5 -5
- package/app/components/Footer/StoreStatus.vue +2 -2
- package/app/components/Footer.vue +125 -57
- package/app/components/Header.vue +283 -18
- package/app/components/Home/Categories.vue +116 -0
- package/app/components/Home/Facts.vue +71 -0
- package/app/components/Home/Faq.vue +34 -16
- package/app/components/Home/Hero.vue +172 -0
- package/app/components/Home/Highlights.vue +29 -37
- package/app/components/Home/Restaurant.vue +102 -0
- package/app/components/Menu/BonCard.vue +180 -0
- package/app/components/Menu/CartPanel.vue +24 -0
- package/app/components/Menu/CategoryIndex.vue +54 -0
- package/app/components/Menu/OrderMode.vue +20 -0
- package/app/components/Menu/SectionHeader.vue +38 -0
- package/app/components/Navigation/MobileTop.vue +23 -15
- package/app/components/Order/Confirmation.vue +119 -0
- package/app/components/Order/Detail.vue +80 -88
- package/app/components/Product/CardSkeleton.vue +8 -12
- package/app/components/Product/Configurator.vue +8 -16
- package/app/components/Product/CrossSelling.vue +75 -83
- package/app/components/Product/DeselectIngredient.vue +17 -22
- package/app/components/Product/Detail.vue +35 -27
- package/app/components/Product/QuickView.vue +80 -51
- package/app/components/SalesChannelSwitch.vue +14 -28
- package/app/components/Sb/Button.vue +70 -0
- package/app/components/Sb/Checkbox.vue +73 -0
- package/app/components/Sb/Chip.vue +51 -0
- package/app/components/Sb/ChoiceGroup.vue +82 -0
- package/app/components/Sb/ConfirmDialog.vue +60 -0
- package/app/components/Sb/Field.vue +77 -0
- package/app/components/Sb/Icon.vue +66 -0
- package/app/components/Sb/IconButton.vue +55 -0
- package/app/components/Sb/Input.vue +23 -0
- package/app/components/Sb/SegmentedControl.vue +34 -0
- package/app/components/Sb/Select.vue +49 -0
- package/app/components/Sb/Sheet.vue +83 -0
- package/app/components/Sb/Stars.vue +60 -0
- package/app/components/Sb/StatusPill.vue +38 -0
- package/app/components/Sb/Stepper.vue +72 -0
- package/app/components/User/AccountHeader.vue +16 -0
- package/app/components/User/AuthPanel.vue +41 -0
- package/app/components/User/Detail.vue +32 -29
- package/app/components/User/LoginForm.vue +92 -98
- package/app/components/User/RegistrationForm.vue +285 -249
- package/app/components/Wishlist.vue +55 -155
- package/app/composables/useCartMutations.ts +9 -27
- package/app/composables/useCheckoutMethodGuard.ts +2 -24
- package/app/composables/useContactForm.ts +66 -0
- package/app/composables/useHomeMenuCategories.ts +41 -0
- package/app/composables/useNavigation.ts +10 -2
- package/app/composables/useOrderMode.ts +65 -0
- package/app/composables/useRegistrationForm.ts +161 -0
- package/app/composables/useRestaurantSchema.ts +1 -1
- package/app/composables/useShareLink.ts +3 -13
- package/app/composables/useSortingSelection.ts +13 -0
- package/app/composables/useThemePreset.ts +15 -0
- package/app/composables/useVoucherCode.ts +7 -16
- package/app/composables/useWishlistActions.ts +0 -51
- package/app/error.vue +31 -9
- package/app/layouts/account.vue +45 -50
- package/app/layouts/default.vue +2 -3
- package/app/layouts/listing.vue +3 -5
- package/app/pages/[...all].vue +8 -4
- package/app/pages/account/recover/password/index.vue +113 -80
- package/app/pages/anmelden.vue +11 -10
- package/app/pages/bestellung/[id]/erfolg.vue +1 -15
- package/app/pages/bestellung/[id]/fehler.vue +63 -51
- package/app/pages/bestellung/[id]/index.vue +3 -85
- package/app/pages/bestellung/kasse.vue +29 -0
- package/app/pages/bestellung.vue +8 -60
- package/app/pages/index.vue +12 -52
- package/app/pages/kontakt.vue +27 -7
- package/app/pages/konto/adressen.vue +106 -102
- package/app/pages/konto/bestellung/[id].vue +9 -43
- package/app/pages/konto/bestellungen.vue +55 -33
- package/app/pages/konto/index.vue +47 -62
- package/app/pages/konto/profil.vue +162 -100
- package/app/pages/maintenance.vue +8 -6
- package/app/pages/merkliste.vue +7 -8
- package/app/pages/passwort-vergessen.vue +92 -75
- package/app/pages/registrierung/bestaetigen.vue +20 -48
- package/app/pages/registrierung/index.vue +16 -7
- package/app/pages/suche.vue +94 -95
- package/app/plugins/theme-preset.ts +9 -0
- package/app/utils/highlight.ts +25 -0
- package/app/utils/product.ts +9 -0
- package/app/validation/registrationSchema.ts +1 -1
- package/modules/theme.ts +115 -0
- package/nuxt.config.ts +27 -15
- package/package.json +6 -8
- package/playwright.config.ts +11 -0
- package/server/api/listing/[categoryId].get.ts +3 -0
- package/shared/theme/presets.ts +303 -0
- package/test/a11y/presets.test.ts +225 -0
- package/test/nuxt/AccountPagesPreset.test.ts +191 -0
- package/test/nuxt/AuthPagesPreset.test.ts +87 -0
- package/test/nuxt/CartCheckoutPreset.test.ts +154 -0
- package/test/nuxt/CartItem.test.ts +18 -3
- package/test/nuxt/CartUpsell.test.ts +1 -2
- package/test/nuxt/CheckoutFormsPreset.test.ts +120 -0
- package/test/nuxt/CheckoutOnePage.test.ts +115 -0
- package/test/nuxt/CheckoutSummary.test.ts +6 -6
- package/test/nuxt/CheckoutVoucherInput.test.ts +20 -32
- package/test/nuxt/ContactFormPreset.test.ts +115 -0
- package/test/nuxt/FooterStoreStatus.test.ts +2 -2
- package/test/nuxt/HeaderFooterPreset.test.ts +134 -0
- package/test/nuxt/HomeFaq.test.ts +3 -2
- package/test/nuxt/MenuBonCard.test.ts +122 -0
- package/test/nuxt/OrderPagesPreset.test.ts +132 -0
- package/test/nuxt/PaymentAndDelivery.test.ts +0 -4
- package/test/nuxt/ProductCrossSelling.test.ts +2 -1
- package/test/nuxt/ProductDeselectIngredient.test.ts +5 -3
- package/test/nuxt/ProductSheetPreset.test.ts +105 -0
- package/test/nuxt/RegisterConfirmPage.test.ts +0 -8
- package/test/nuxt/RegistrationForm.test.ts +89 -270
- package/test/nuxt/SbBaseComponents.test.ts +170 -0
- package/test/nuxt/SbStars.test.ts +25 -0
- package/test/nuxt/useCartMutations.test.ts +3 -17
- package/test/nuxt/useCartUpsell.test.ts +1 -1
- package/test/nuxt/useCheckoutMethodGuard.test.ts +0 -27
- package/test/nuxt/useShareLink.test.ts +1 -9
- package/test/nuxt/useWishlistActions.test.ts +3 -26
- package/test/unit/highlight.spec.ts +31 -0
- package/test/unit/product.spec.ts +12 -0
- package/test/unit/themePresets.spec.ts +61 -0
- package/app/app.config.ts +0 -19
- package/app/components/AnimatedSection.vue +0 -74
- package/app/components/BottomNavi.vue +0 -70
- package/app/components/Category/Header.vue +0 -48
- package/app/components/Checkout/PaymentMethod.vue +0 -30
- package/app/components/Checkout/ShippingMethod.vue +0 -30
- package/app/components/Cta.vue +0 -30
- package/app/components/Feature/Card.vue +0 -121
- package/app/components/Features.vue +0 -42
- package/app/components/Footer/Contact.vue +0 -82
- package/app/components/Header/Body.vue +0 -82
- package/app/components/Header/Right.vue +0 -187
- package/app/components/Header/Title.vue +0 -10
- package/app/components/Hero.vue +0 -233
- package/app/components/Home/MenuCategories.vue +0 -148
- package/app/components/ImageGallery.vue +0 -63
- package/app/components/Loading.vue +0 -29
- package/app/components/Navigation/DesktopLeft.vue +0 -39
- package/app/components/Product/Card.vue +0 -177
- package/app/components/Product/CardCompact.vue +0 -72
- package/app/components/Product/CardDietBadges.vue +0 -43
- package/app/components/Product/CardIngredients.vue +0 -35
- package/app/components/Product/CardKitchen.vue +0 -34
- package/app/components/Product/SearchBar.vue +0 -95
- package/app/components/PublicAnnouncement.vue +0 -17
- package/app/pages/bestellung/bestaetigen.vue +0 -16
- package/app/pages/bestellung/warenkorb.vue +0 -49
- package/app/pages/bestellung/zahlung-versand.vue +0 -25
- package/test/nuxt/AddressFields.test.ts +0 -222
- package/test/nuxt/AnimatedSection.test.ts +0 -67
- package/test/nuxt/ContactForm.test.ts +0 -207
- package/test/nuxt/FooterContact.test.ts +0 -102
- package/test/nuxt/HeaderRight.test.ts +0 -142
- package/test/nuxt/Hero.test.ts +0 -126
- package/test/nuxt/HomeMenuCategories.test.ts +0 -94
- package/test/nuxt/LoginForm.test.ts +0 -159
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect, vi, beforeEach } from "vitest";
|
|
2
|
-
import { mountSuspended, mockNuxtImport } from "@nuxt/test-utils/runtime";
|
|
3
|
-
import { ref } from "vue";
|
|
4
|
-
import LoginForm from "@/components/User/LoginForm.vue";
|
|
5
|
-
import { ApiClientError } from "@shopware/api-client";
|
|
6
|
-
|
|
7
|
-
type LoginFormVm = {
|
|
8
|
-
onSubmit: (arg: {
|
|
9
|
-
data: { email: string; password: string };
|
|
10
|
-
}) => Promise<void>;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
vi.mock("@shopware/api-client", () => ({
|
|
14
|
-
ApiClientError: class extends Error {
|
|
15
|
-
details: unknown;
|
|
16
|
-
constructor(details: unknown) {
|
|
17
|
-
super("ApiClientError");
|
|
18
|
-
this.details = details;
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
}));
|
|
22
|
-
|
|
23
|
-
vi.mock("@shopware/composables", () => ({
|
|
24
|
-
useUser: vi.fn(),
|
|
25
|
-
useWishlist: vi.fn(),
|
|
26
|
-
}));
|
|
27
|
-
|
|
28
|
-
const mockToastAdd = vi.fn();
|
|
29
|
-
mockNuxtImport("useToast", () => {
|
|
30
|
-
return () => ({
|
|
31
|
-
add: mockToastAdd,
|
|
32
|
-
});
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
const loginMock = vi.fn();
|
|
36
|
-
const userMock = ref({ firstName: "John", lastName: "Doe" });
|
|
37
|
-
const isLoggedInMock = ref(false);
|
|
38
|
-
|
|
39
|
-
mockNuxtImport("useUser", () => {
|
|
40
|
-
return () => ({
|
|
41
|
-
isLoggedIn: isLoggedInMock,
|
|
42
|
-
login: loginMock,
|
|
43
|
-
user: userMock,
|
|
44
|
-
});
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
mockNuxtImport("useWishlist", () => {
|
|
48
|
-
return () => ({
|
|
49
|
-
mergeWishlistProducts: vi.fn(),
|
|
50
|
-
});
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
describe("LoginForm", () => {
|
|
54
|
-
beforeEach(() => {
|
|
55
|
-
vi.clearAllMocks();
|
|
56
|
-
loginMock.mockReset();
|
|
57
|
-
isLoggedInMock.value = false;
|
|
58
|
-
userMock.value = { firstName: "John", lastName: "Doe" };
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
it("should show success toast on successful login", async () => {
|
|
62
|
-
loginMock.mockResolvedValueOnce({});
|
|
63
|
-
const wrapper = await mountSuspended(LoginForm);
|
|
64
|
-
|
|
65
|
-
// Call onSubmit directly if form trigger is not working in test
|
|
66
|
-
await (wrapper.vm as unknown as LoginFormVm).onSubmit({
|
|
67
|
-
data: {
|
|
68
|
-
email: "test@example.com",
|
|
69
|
-
password: "password123",
|
|
70
|
-
},
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
expect(loginMock).toHaveBeenCalledWith({
|
|
74
|
-
username: "test@example.com",
|
|
75
|
-
password: "password123",
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
expect(mockToastAdd).toHaveBeenCalledWith(
|
|
79
|
-
expect.objectContaining({
|
|
80
|
-
title: "Hallo John Doe!",
|
|
81
|
-
description: "Erfolgreich angemeldet.",
|
|
82
|
-
color: "success",
|
|
83
|
-
}),
|
|
84
|
-
);
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
it("should show error toast on failed login", async () => {
|
|
88
|
-
loginMock.mockRejectedValueOnce(new Error("Invalid credentials"));
|
|
89
|
-
const wrapper = await mountSuspended(LoginForm);
|
|
90
|
-
|
|
91
|
-
// Call onSubmit directly if form trigger is not working in test
|
|
92
|
-
await (wrapper.vm as unknown as LoginFormVm).onSubmit({
|
|
93
|
-
data: {
|
|
94
|
-
email: "test@example.com",
|
|
95
|
-
password: "wrongpassword",
|
|
96
|
-
},
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
expect(loginMock).toHaveBeenCalled();
|
|
100
|
-
|
|
101
|
-
expect(mockToastAdd).toHaveBeenCalledWith(
|
|
102
|
-
expect.objectContaining({
|
|
103
|
-
title: "Login fehlgeschlagen",
|
|
104
|
-
description: "Bitte überprüfen Sie Ihre Zugangsdaten.",
|
|
105
|
-
color: "error",
|
|
106
|
-
}),
|
|
107
|
-
);
|
|
108
|
-
});
|
|
109
|
-
|
|
110
|
-
it("should show detailed error toast on ApiClientError", async () => {
|
|
111
|
-
const apiClientError = new ApiClientError({
|
|
112
|
-
errors: [
|
|
113
|
-
{
|
|
114
|
-
detail: 'The email address "test@example.com" is already in use',
|
|
115
|
-
},
|
|
116
|
-
],
|
|
117
|
-
} as unknown as ConstructorParameters<typeof ApiClientError>[0]);
|
|
118
|
-
loginMock.mockRejectedValueOnce(apiClientError);
|
|
119
|
-
const wrapper = await mountSuspended(LoginForm);
|
|
120
|
-
|
|
121
|
-
await (wrapper.vm as unknown as LoginFormVm).onSubmit({
|
|
122
|
-
data: {
|
|
123
|
-
email: "test@example.com",
|
|
124
|
-
password: "password123",
|
|
125
|
-
},
|
|
126
|
-
});
|
|
127
|
-
|
|
128
|
-
expect(mockToastAdd).toHaveBeenCalledWith(
|
|
129
|
-
expect.objectContaining({
|
|
130
|
-
title: "Login fehlgeschlagen",
|
|
131
|
-
description: 'The email address "test@example.com" is already in use',
|
|
132
|
-
color: "error",
|
|
133
|
-
}),
|
|
134
|
-
);
|
|
135
|
-
});
|
|
136
|
-
|
|
137
|
-
it("should handle ApiClientError with missing errors gracefully", async () => {
|
|
138
|
-
const apiClientError = new ApiClientError(
|
|
139
|
-
{} as unknown as ConstructorParameters<typeof ApiClientError>[0],
|
|
140
|
-
);
|
|
141
|
-
loginMock.mockRejectedValueOnce(apiClientError);
|
|
142
|
-
const wrapper = await mountSuspended(LoginForm);
|
|
143
|
-
|
|
144
|
-
await (wrapper.vm as unknown as LoginFormVm).onSubmit({
|
|
145
|
-
data: {
|
|
146
|
-
email: "test@example.com",
|
|
147
|
-
password: "password123",
|
|
148
|
-
},
|
|
149
|
-
});
|
|
150
|
-
|
|
151
|
-
expect(mockToastAdd).toHaveBeenCalledWith(
|
|
152
|
-
expect.objectContaining({
|
|
153
|
-
title: "Login fehlgeschlagen",
|
|
154
|
-
description: "Bitte überprüfen Sie Ihre Zugangsdaten.",
|
|
155
|
-
color: "error",
|
|
156
|
-
}),
|
|
157
|
-
);
|
|
158
|
-
});
|
|
159
|
-
});
|