Skip to content

Commit

Permalink
fix: DiscountsCustomView.filters and `DiscountsCustomViewInput.filt…
Browse files Browse the repository at this point in the history
…er` generated data (#606)

* fix: `DiscountsCustomView.filters` and `DiscountsCustomViewInput.filter` generated data

* fix: add `/models/discounts-custom-view` to CODEOWNERS file
  • Loading branch information
ragafus authored Jun 21, 2024
1 parent d28fde8 commit 445c888
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 22 deletions.
5 changes: 5 additions & 0 deletions .changeset/tough-terms-mix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@commercetools-test-data/discounts-custom-view': patch
---

Fix `DiscountsCustomView.filters` and `DiscountsCustomViewInput.filter` generated data
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
/models/customer @commercetools/customers-team-fe
/models/customer-group @commercetools/customers-team-fe
/models/discount-code @commercetools/priceless-team-fe
/models/discounts-custom-view @commercetools/priceless-team-fe
/models/filter-values @commercetools/priceless-team-fe
/models/inventory-entry @commercetools/pacman-team-fe
/models/order @commercetools/checkout-team-fe
Expand Down
26 changes: 16 additions & 10 deletions models/discounts-custom-view/src/builder.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ describe('builder', () => {
table: null,
search: expect.any(String),
type: expect.any(String),
filters: expect.objectContaining({
id: expect.any(String),
}),
filters: expect.arrayContaining([
expect.objectContaining({
id: expect.any(String),
}),
]),
sort: null,
})
)
Expand All @@ -47,9 +49,11 @@ describe('builder', () => {
table: null,
search: expect.any(String),
type: expect.any(String),
filters: expect.objectContaining({
id: expect.any(String),
}),
filters: expect.arrayContaining([
expect.objectContaining({
id: expect.any(String),
}),
]),
sort: null,
})
)
Expand All @@ -76,10 +80,12 @@ describe('builder', () => {
table: null,
search: expect.any(String),
type: expect.any(String),
filters: expect.objectContaining({
id: expect.any(String),
__typename: 'FilterValues',
}),
filters: expect.arrayContaining([
expect.objectContaining({
id: expect.any(String),
__typename: 'FilterValues',
}),
]),
sort: null,
__typename: 'DiscountsCustomView',
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ describe('builder', () => {
}),
table: null,
search: expect.any(String),
filters: expect.objectContaining({
id: expect.any(String),
}),
filters: expect.arrayContaining([
expect.objectContaining({
id: expect.any(String),
}),
]),
sort: null,
})
)
Expand All @@ -36,9 +38,11 @@ describe('builder', () => {
}),
table: null,
search: expect.any(String),
filters: expect.objectContaining({
id: expect.any(String),
}),
filters: expect.arrayContaining([
expect.objectContaining({
id: expect.any(String),
}),
]),
sort: null,
})
)
Expand All @@ -61,10 +65,12 @@ describe('builder', () => {
]),
table: null,
search: expect.any(String),
filters: expect.objectContaining({
id: expect.any(String),
__typename: 'FilterValues',
}),
filters: expect.arrayContaining([
expect.objectContaining({
id: expect.any(String),
__typename: 'FilterValues',
}),
]),
sort: null,
})
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const generator = Generator<TDiscountsCustomViewInput>({
name: fake(() => LocalizedString.random()),
table: null,
search: fake((f) => f.lorem.word()),
filters: fake(() => FilterValues.random()),
filters: fake(() => [FilterValues.random()]),
sort: null,
},
});
Expand Down
2 changes: 1 addition & 1 deletion models/discounts-custom-view/src/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const generator = Generator<TDiscountsCustomView>({
table: null,
search: fake((f) => f.lorem.word()),
type: oneOf('ProductDiscount', 'CartDiscount', 'DiscountCode'),
filters: fake(() => FilterValues.random()),
filters: fake(() => [FilterValues.random()]),
sort: null,
},
});
Expand Down

0 comments on commit 445c888

Please sign in to comment.