feat(medusa): invalidate price selection caching within update request (#3553)
* feat: invalidate price selection caching on update * feat: add `onVariantsPricesUpdate` to PriceSelectionStrategy * fix: update units * fix: import * Create .changeset/tame-pillows-heal.md * fix: address feedback * refactor: make `onVariantsPricesUpdate` optional --------- Co-authored-by: fPolic <frane@medusajs.com> Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
This commit is contained in:
@@ -44,7 +44,7 @@ describe("/admin/products", () => {
|
||||
dbConnection = await initDb({ cwd })
|
||||
medusaProcess = await setupServer({
|
||||
cwd,
|
||||
env: { MEDUSA_FF_PRODUCT_CATEGORIES: true }
|
||||
env: { MEDUSA_FF_PRODUCT_CATEGORIES: true },
|
||||
})
|
||||
})
|
||||
|
||||
@@ -1784,7 +1784,9 @@ describe("/admin/products", () => {
|
||||
})
|
||||
|
||||
expect(response.status).toEqual(200)
|
||||
const variant = response.data.product.variants.find(v => v.id === variantId)
|
||||
const variant = response.data.product.variants.find(
|
||||
(v) => v.id === variantId
|
||||
)
|
||||
expect(variant.prices.length).toEqual(1)
|
||||
expect(variant.prices).toEqual(
|
||||
expect.arrayContaining([
|
||||
|
||||
Reference in New Issue
Block a user