Skip to content

Commit

Permalink
feat(composables): add tests (#431)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdanilowicz committed Oct 30, 2023
1 parent 85628cc commit 87213fb
Show file tree
Hide file tree
Showing 11 changed files with 1,732 additions and 105 deletions.
5 changes: 5 additions & 0 deletions .changeset/selfish-moons-exercise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@shopware-pwa/composables-next": minor
---

Add tests for `useProductAssociations`, `useProductConfigurator`, `useProductPrice`
123 changes: 123 additions & 0 deletions packages/composables/src/mocks/Configurator.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
const Configurator = [
{
translated: {
name: "Colour",
description: null,
position: 1,
customFields: {},
},
createdAt: "2020-08-06T06:26:29.726+00:00",
updatedAt: null,
name: "Colour",
displayType: "text",
sortingType: "alphanumeric",
description: null,
position: 1,
filterable: true,
visibleOnProductDetailPage: true,
options: [
{
translated: { name: "red", position: 13, customFields: {} },
createdAt: "2020-08-06T06:26:29.679+00:00",
updatedAt: null,
groupId: "15de997512de4e229d2db1b72aca16f5",
name: "red",
position: 13,
colorHexCode: null,
mediaId: null,
group: null,
media: null,
customFields: null,
id: "cc02c6cf39ad43d5856a25f8928490bf",
apiAlias: "property_group_option",
},
{
translated: { name: "blue", position: 17, customFields: {} },
createdAt: "2020-08-06T06:26:29.667+00:00",
updatedAt: null,
groupId: "15de997512de4e229d2db1b72aca16f5",
name: "blue",
position: 17,
colorHexCode: null,
mediaId: null,
group: null,
media: null,
customFields: null,
id: "862a4c3c1326423a874b25b6d9ae2101",
apiAlias: "property_group_option",
},
],
customFields: null,
id: "15de997512de4e229d2db1b72aca16f5",
apiAlias: "property_group",
},
{
translated: {
name: "Size",
description: null,
position: 1,
customFields: {},
},
createdAt: "2020-08-06T06:26:29.930+00:00",
updatedAt: null,
name: "Size",
displayType: "text",
sortingType: "alphanumeric",
description: null,
position: 1,
filterable: true,
visibleOnProductDetailPage: true,
options: [
{
translated: { name: "L", position: 24, customFields: {} },
createdAt: "2020-08-06T06:26:29.930+00:00",
updatedAt: null,
groupId: "6d71c64e67d64876b9c7fbb97fcba3c6",
name: "L",
position: 24,
colorHexCode: null,
mediaId: null,
group: null,
media: null,
customFields: null,
id: "f13d254355cc41e28637e3428e23f279",
apiAlias: "property_group_option",
},
{
translated: { name: "M", position: 23, customFields: {} },
createdAt: "2020-08-06T06:26:29.877+00:00",
updatedAt: null,
groupId: "6d71c64e67d64876b9c7fbb97fcba3c6",
name: "M",
position: 23,
colorHexCode: null,
mediaId: null,
group: null,
media: null,
customFields: null,
id: "24495f5441004fb9bcde8e1645714063",
apiAlias: "property_group_option",
},
{
translated: { name: "S", position: 22, customFields: {} },
createdAt: "2020-08-06T06:26:29.923+00:00",
updatedAt: null,
groupId: "6d71c64e67d64876b9c7fbb97fcba3c6",
name: "S",
position: 22,
colorHexCode: null,
mediaId: null,
group: null,
media: null,
customFields: null,
id: "dcd3a971b122413785ed56a5782ed5b7",
apiAlias: "property_group_option",
},
],
customFields: null,
id: "6d71c64e67d64876b9c7fbb97fcba3c6",
apiAlias: "property_group",
},
];

export default Configurator;
Loading

1 comment on commit 87213fb

@vercel
Copy link

@vercel vercel bot commented on 87213fb Oct 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.