Skip to content

Commit

Permalink
SW6: edited apiRemoveLineItem interceptor url and method
Browse files Browse the repository at this point in the history
  • Loading branch information
dm-heinze committed Aug 7, 2024
1 parent 1782243 commit 82e9480
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 31 deletions.
7 changes: 7 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,12 @@
"no-useless-return": [
"off"
]
},
"settings": {
"import/resolver": {
"node": {
"extensions": [".js", ".jsx", ".ts", ".tsx"]
}
}
}
}
7 changes: 5 additions & 2 deletions cypress/e2e/platform-sw.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ describe('Platform: Shopware', () => {

// cart off-canvas menu
cy.get('.navbar-end .btn:last').click()
cy.wait(500)
cy.get('.drawer-side .avatar').should('have.lengthOf', 1)

// cart page
Expand All @@ -71,8 +72,8 @@ describe('Platform: Shopware', () => {

it('removes product from cart', () => {
cy.intercept({
method: 'DELETE',
url: '/store-api/**'
method: 'POST',
url: '/store-api/checkout/cart/line-item/delete'
}).as('apiRemoveLineItem')

cy.visit('/')
Expand All @@ -81,6 +82,7 @@ describe('Platform: Shopware', () => {

// cart off-canvas menu
cy.get('.navbar-end .btn:last').click()
cy.wait(500)

cy.get('.flex.flex-col.gap-6 > div > .flex.flex-col.gap-2').children().then(($element) => {
const count = $element.length
Expand All @@ -107,6 +109,7 @@ describe('Platform: Shopware', () => {

// navigates from cart off-canvas menu to checkout
cy.get('.navbar-end .btn:last').click()
cy.wait(500)
cy.get('.drawer-side').contains('Checkout').click()

// registers in checkout as guest on checkout contact section
Expand Down
54 changes: 27 additions & 27 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hubblecommerce/hubble",
"version": "2.7.0",
"version": "2.8.0",
"description": "PWA for eCommerce frameworks based on NuxtJs",
"author": "hubble commerce",
"license": "MIT",
Expand Down Expand Up @@ -49,7 +49,7 @@
"coverage": "vitest run --coverage",
"docs:dev": "vuepress dev docs",
"docs:build": "vuepress build docs",
"sw:dev:generate-api": "node bin/hubble-cli.js dev:sw open-api-generate && git apply src/platforms/shopware/api-client/*.patch --verbose",
"sw:dev:generate-api": "node bin/hubble-cli.js dev:sw open-api-generate",
"sw:dev:patch-api": "git format-patch -1 $COMMIT -o src/platforms/shopware/api-client/",
"sw:install-plugins": "node bin/hubble-cli.js dev:sw sw-plugins-assets",
"sw:config-plugins": "node bin/hubble-cli.js dev:sw sw-plugins-config",
Expand Down
7 changes: 7 additions & 0 deletions update.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
- New useCustomer function named logoutGuest to logout guest customers, because logout request is allowed for logged in customers only
- Store API responses of login and register don't include context anymore, context token is now set based on response header instead
- CartShopware.removeLineItem request body has changed and requires an object with an ids property
- CartShopware.addLineItem request body has changed and requires id for each item instead of referenceId
- usePage associations requires now seoUrls to resolve seoUrls
- ProductShopware.readProductListing function parameters changes, second parameter is now swIncludeSeoUrls boolean
- Unused property pathInfo was removed from HblProduct type and mapping

0 comments on commit 82e9480

Please sign in to comment.