* Make useStoreNotices interact directly with the store
* Get/set error notices directly in store in paymentMethodDataContext
* Add hasNoticesOfType util
* Remove useStoreNotices and interact directly with data store
* Create/remove notices directly in store
* Remove tests for useStoreNotices
* Add tests for notices util
* Use setIsSuppressed from useStoreNoticesContext
* remove useStoreNotices hook
* Update context typedef to define only isSuppressed and setIsSuppressed
* Remove all values from StoreNoticesContext besides setIsSuppressed
* Wrap Cart and Checkout blocks in StoreNoticesProvider (for isSuppressed)
* Make StoreNoticesContainer a named export
This is required so we can import it from @wooommerce/base-context
* Change addErrorNotice to createErrorNotice to match store action
* Remove unnecessary StoreNoticeProviders and pass only context to container
* Accept a context in StoreNoticesContainer
* Pass relevant context to StoreNoticesContainer
* Add function to remove notices by status
* Prevent checkout from breaking when removing notices during processing
* Prevent TS error about not included path
* Add StoreNoticesContainer to single product block
* Add StoreNoticesContainer to All Products Block
* Ensure errors are shown when using All Products & Single Product Blocks
* Add a context arg to removeNoticesByStatus
* Use correct contexts for all products and single product block
* Update tests to reflect new context argument
* Re-add missing block file for order-summary
* Remove block file for order-summary
* Send context to useStoreCartCoupons to show errors correctly
* Check for performance file existence before running
* check reports/performance-report.json file exists on setup
Co-authored-by: Alex Florisca <alex.florisca@automattic.com>
* Add performance script to measure load times of cart and checkout blocks
* Temp commit
* Temp commit
* Temp commit
* Remove specific test from performance e2e command
* Add performance reporter
* Add step to clean performance file before running tests
* Add test report constant & average and logPerformanceResult test utils
* Update uses of product name constant
* Add cart coupon performance test
* Check if report file is empty before parsing
* Limit performance tests to only ones in performance directory
* Round the averages and add a linebreak after each entry in the log
* Fix formatting of report and only output after all tests
* Log each loading metric as an individual data point
* Improve formatting
* Get load times in ms from profiler
* Revert changes to fixtures
* Remove trace.json from git
* Remove checkout test file (tests not implemented)
* Check performance log file exists before truncating it
* Fix checkout coupon test
* Remove console logs
* Revert to use virtual products after rename of constant
* Ignore performance tests when running regular e2e tests
* Feedback changes
* Tidy up
* Fix packag-log.json:
Co-authored-by: Alex Florisca <alex.florisca@automattic.com>
* Rename `Product Title` `Content` panel to `Link settings`
* Rename toggle `Link to Product Page` to `Make title a link`
* Remove help text
* Add `rel` and `linkTarget` to the `Product Title` settings
* Add `rel` and `linkTarget` to the `Product Title` block
* Only add the `target` attribute if the title is rendered as a link
* Keep the `nofollow` in rel as it was before
* Make `linkTarget` and `rel` optional
To not change the html generated for other components also using `ProductName`
* Add tests fotr the `Title` component
* Improve rel condition
* Extract `linkRel` variable
* Remove unnecessary undefined
* Remove the default value for `linkTarget`
Since it is the default behavior of the browsers, we don't need it.
* Remove the `nofollow` rel value
It was decided to remove it since it's a link to internal pages.
See the PR discussion for more context.
* Remove the `rel` option
It does not have much sense to have it since it's always an internal link.
See the PR discussion for more context.
* Clean-up `rel` related code
* Add "single-use" coupon to the fixture data
* Create a first draft of the coupon e2e test
* Create single use coupon code constant
* Create "applyCouponFromCheckout" function
* Remove the "single-use" coupon from the fixture data
* Setup coupon creation using Woo's Rest API
* Add single-use coupon E2E test
* Move discount XPath definition to the expressions file
* Clean comments
* Remove unnecessary delay function
* Refactor to a more human friendly check
* Clear the setup in the afterAll branch (delete coupon)
Co-authored-by: Saad Tarhi <saad.tarhi@automattic.com>
* Sub/Total/Fee inner blocks
* Row blocks within the inner block
* Update icons
* Resolve stying issues
* Remove old block
* Pin totals row
* Locking logic update
* Heading inner block
* Refactor where inner blocks are defined
* Add todos
* Todo for Consider deprecating OrderMetaSlotFill and DiscountSlotFill in favour of inner block areas.
* Improve frontend registration of components using new entrypoint
* Experiment- external block context
* Revert "Experiment- external block context"
This reverts commit 4b75668ec7eb62f065c6a488cd942a666e26204f.
* Duplicate inner blocks to avoid conflicts with context
* Remove todo
* Rename block dir
* Some test fixes
* Fix import
* fix import
* linting
* Remove unused attributes
* Optional classname
* fix coupons import
* fix shipping mocks
* Styling
* Fix selectors in e2e tests
* Add back the wc-block-components-totals-wrapper class that was used for each segment in the totals Order summary
Because, removing them was:
- a breaking change for the old structure
- was making it harder to target the inner blocks. Before the class was used to target each segment
- it was making the wc-block-components-totals-item behave as a child or parent depending on the inner block, inconsitency
* Reuse the TotalsWrapper component for C& C blocks inner blocks
This component was removed in this PR, but we wrap components in the Cart and Checkout sidebar in a TotalsWrapper. This will ensure consistent spacing and borders are applied to items in the sidebar.
Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
Co-authored-by: Raluca Stan <ralucastn@gmail.com>
* Add tests for the Mini Cart Block when it is added on the FSE editor woocommerce/woocommerce-blocks#5727
Add tests for the Mini Cart Block when it is added on the FSE editor
* not hardcoding selectors
* fix typo
* restore old searchForBlock function
* add export
* Revert "restore old searchForBlock function"
This reverts commit 7049ad85bc2752ad33933eec00da9682943ec35a.
* use searchForBlock from package only for FSE pages
* add fix for GB
* Cleanup e2e jest config from moduleFileExtensions
moduleFileExtensions by default support js, ts, tsx etc.
* convert legacy-template-blocks e2e test to TS
* clean up jest.config.json moduleFileExtensions
unnecessary defaults override
* Prevent accessing the first element of the `parentProduct` array if empty
* Include all products regardless of their `stock_status`
By default, the `/wc/store/v1/products` endpoint does not return products with
`outofstock` stock status. We want the users to be able to select any product
regardless of its stock status, we need to explicitly request them using the
`stock_status` query param.
* Use the optional chaining operator
Co-authored-by: Tomasz Tunik <tomasztunik@gmail.com>
* Shopper can have different shipping and billing addresses
* Shopper can have different shipping and billing addresses
* Shopper can have different shipping and billing addresses
* Correct billing field IDs
* Remove unused variable
* Remove unused timeout
* Remove unused commands
* Activate company field using setCheckbox
* Deactivate company field using unsetCheckbox
* Remove obsolete command
* Empty cart before and after each test
* Remove obsolete import
* Check billing and shipping company
* Remove manual code with unsetCheckbox
* Fill company if field exist
* Get checkbox ID from label
* Remove duplicate company field toFill method
Co-authored-by: Saad Tarhi <saad.trh@gmail.com>
Co-authored-by: Saad Tarhi <saad.tarhi@automattic.com>
* Empty commit for release pull request
* Updated changelog
* Prepare the Mini Cart block for Feature Plugin (https://github.com/woocommerce/woocommerce-blocks/pull/6127)
* Release notes
* Update plugin url
* Add 730 to README testing
* Remove PR from testing notes and changelog
* Remove PR from testing notes
* Allow memoized filters to re-run if `defaultArg` changes (https://github.com/woocommerce/woocommerce-blocks/pull/6102)
* Check the last defaultArg to decide whether we re-run filters
* Fake commit to make CI run
* Revert change to .gitignore to make CI run
* Update testing instructions
* Update testing instructions
* Update download link
* Bumping version strings to new version.
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: tjcafferkey <tjcafferkey@gmail.com>
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
* upgrade wordpress/scripts to 22.3
* update jest config/setup
* add explicit-exports-references plugin
to handle payment-method-config.tsx spying on external methods
the way code is output now changed and tests like this would not
work anymore as transpilet files were no longer using exports but
local references to methods.
* missing snapshot
* make cart-products E2E test more stable
* surppress eslint error in test file
* fix css stylelint issues
* update eslint-plugin-woocommerce eslint package
* remove temp test:e2e:start script
* re-run
* add stylelint as recommended extension
* remove redundant types (provided by packages now)
* patch update @testing-library/jest-dom
* dry getAllTemplates util
* Improve goToSiteEditor e2e util
It will now properly wait for page to load
and critical parts to be available before
handing control over to the next steps
* adapt site editing tests to new goToSiteEditor API
* try to stabilize the saveTemplate
to early navigation was causing the dreaded
"Expected an Error, but "" was thrown"
* try stabilizing saveTemplate
* contextually group/sort params
* improve clarity of the goToSiteEditor E2E util
- adds goToSiteEditor private helper that hides the temporary need
for handling theme.php and site-editor.php paths
- adds two exported utils goToTemplatesList and goToTemplateEdit
that hide UX details of waiting ofr page to be ready on load including special
case for waitingFor templates list actions to be loaded
* put back page where it belongs ⚡️
* Create "isLoggedIn" shopper function
This function checks if a shopper is logged in
* Add "Can see warnings when form is incomplete" test
* Optimize login check and logout process for the test
Co-authored-by: Saad Tarhi <saad.tarhi@automattic.com>
* Filter Products by Attribute: Fix dropdown search case sensitivity handling
* Refactor the dropdown search logic and add an isCaseSensitive option
* Dropdown search: Match against the name rather than value
* Clean up and refactor the search dropdown code
* Add handling of editor context via GUTENBERG_EDITOR_CONTEXT env var
* Fix flaky tests around editing templates
* Wait for save template response to complete
* Add XPath expressions
* Add "setCartQuantity" utility function
* Add "productIsInCart" utility function
* Add "update product qty" e2e test
* Clean up test file
* Fix test on headless mode
* Add Increase/Decrease qty test cases
* Decrease the query chain for better maintainability
* Rename expression functions/file for more clarity
* Resolve conflict with trunk
Co-authored-by: Saad Tarhi <saad.tarhi@automattic.com>