Commit Graph

36 Commits

Author SHA1 Message Date
Chi-Hsuan Huang 9aba93d127 Update all js packages with minor/patch version changes (https://github.com/woocommerce/woocommerce-admin/pull/8392)
* Update all js packages with minor/patch version changes

* Add changelog

* Fix packages/data types errors

* Update data/CHANGELOG.md

* Fix puppeteer version

* Fix packages/data > countries error types

* Make data key optional in RestApiError
2022-03-08 10:11:12 +08:00
Chi-Hsuan Huang 86fc8b62e5 Switch to pnpm (https://github.com/woocommerce/woocommerce-admin/pull/8349)
* Add pnpm-workspace.yaml

* Add missing dependencies & replace file: with workspace:* in
package.json

* Replace "npm" with "pnpm"

* Replace "npx" with "pnpx"

* Remove package-lock.json

* Add pnpm setup action to github workflows

* Update webpack babel exclude path

* Upgrade woo e2e and fix e2e test command

Update e2e.yml

Use pnpm run e2e:docker-up in e2e.yml

* Remove unused docker-compose.yaml

* Replace lerna with pnpm commands

Update publish commands

* Exclude _locutus_shared_bc.js in babel.config.js

* Add .npmrc to set enable-pre-post-scripts=true by default

* Fix storybook babel config

Update babel.config.js

* Add changelog

* Update pnpm-lock.yaml

* Replace pnpx with pnpm exec

* Update pnpm-lock.yaml

* Remove js-tests/package-lock.json

* Fix @woocommerce/tracks -> workspace:*

* Update pnpm-lock.yaml

* Add @woocommerce/experimental to onboarding/package.json

* Add "@woocommerce/component" to onboarding/package.json

* Update pnpm-lock.yaml

* Use || instead of && for "test:watch"

Co-authored-by: RJ <27843274+rjchow@users.noreply.github.com>

* Fix packages/number "clean" command

* Add root: true to .eslintrc.js to enforce it to use the root config file

* Exclude packages/**/node_modules from babel transpiling

* Fix js-tests build config

Co-authored-by: RJ <27843274+rjchow@users.noreply.github.com>
2022-03-04 12:01:16 +08:00
RJ f306cc2ba5 Enable Typescript checking on ./client folder (https://github.com/woocommerce/woocommerce-admin/pull/8372)
* Copied .tsconfig into ./client to enable ts checking

- Made sub-repos composite typescript packages where necessary

* Prevent tsc from transpiling ./client

 - we use webpack for transpiling so no need for this

* Added tsc resolution path for @automattic/explat-client

- Seems like there's a type export issue (?) with @automattic/explat-client and @automattic/explat-client-react-helpers
- adding the node_modules/@automattic/explat-client path in tsconfig seems to help TS resolve this using the source .ts files
- found answer here: https://github.com/microsoft/TypeScript/issues/42873
- should figure out what's actually wrong with the type exports and fix that there instead

* Removed mandatory checking from webpack

- removed this for now as it will block all development until all type inconsistencies are fixed
- for now, run the optional ts:check task either in console or vscode for highlighting type errors

* Added vscode tasks for typescript checking

* Patch @automattic/explat-client-react-helpers

- this changes the installed code in node_modules (post-installation) for @automattic/explat-client-react-helpers so that it exports the necessary type interfaces required by us
- attempted unsuccessfully to override type exports using declare module
- not too sure how to fix this internally by other means
- have to investigate what fixes to propose to @automattic/explat-client-react-helpers team

* changed tests in ./client to use ts-jest instead of babel-jest

- rewrote jest config to use ts-jest instead of babel-jest
- set ts errors to warnings instead so that tests don't fail on type errors
- created new tsconfig for ./packages/js-tests so that build and ts-check are separate, as js-tests need to be built for commonjs
2022-03-01 12:19:07 +08:00
Moon 718bac6981 Prompt a modal to save any unsaved changes in OBW (https://github.com/woocommerce/woocommerce-admin/pull/8278)
* Add a modal to show when unsaved changes are detected

* Add functions to track value changes from the steps

* Warn unsaved changes for the store details

* Add styles for the unsaved modal

* Warn unsaved changes for the Industry

* Warn unsaved changes for the Product Types

* Warn unsaved changes for the Business Details

* Add changelog

* Add testing instructions.

* Sort array values before comparison

* Use only the array values to compare the diff

* Catch rejected promise on continue

* Set initial value to an empty object

* Fix failing tests
2022-02-17 11:15:11 -08:00
louwie17 d41906267a Dev/e2e reset (https://github.com/woocommerce/woocommerce-admin/pull/8219)
* Add payment_setup track for WooCommerce Payments

* Add WooCommerce Reset Plugin to E2E environment

* Add resetWoComerceState util

* Add state reset before obw test

* Refactor resetWooCommerceState

resetWooCommerceState now makes the HTTP request locally instead of from inside the browser context.

* Update reset functionality

* Add custom settings reset function for onboarding

* Update reset functionality

* Add action-scheduler run helper function

* Fix add section test

* Add plugin removal helper functions

* Fix lint errors

* Fix broken e2e tests

* Add changelog

* Remove unused imports

* Add comment for extra timeout

* Add helper function to wait until button stops moving, incase of animations

* Fix lint error

* Add variable for string used in multiple places

Co-authored-by: Adrian Duffell <9312929+adrianduffell@users.noreply.github.com>
2022-02-02 08:55:10 -04:00
Fernando b74600593e Change the reviews empty state panels logic (https://github.com/woocommerce/woocommerce-admin/pull/8147)
* Add unapproved reviews check

* Add tests

* Add changelog

* Create a review e2e test

* Fix lint

* Rename some constants (https://github.com/woocommerce/woocommerce-admin/pull/8178)

* Renamed `countUnapprovedReviews`

* Renamed `lowStockProductsCount`

* Renamed `unreadOrdersCount`

Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>

Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
2022-01-19 13:45:17 -03:00
Fernando 00055f69e4 Add e2e tests for PR 7963 (https://github.com/woocommerce/woocommerce-admin/pull/7996)
* Add e2e tests for PR 7963

* Fix lint

* Verify the next screen is shown

* Simplifying product types step

* Add className to SelectControl

* Fix e2e test

* Removed not used dependency

* Add method `expandRecommendedBusinessFeatures`

* Fixed style selectors

* Add default value to `name`.

Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
2021-12-21 09:58:15 -03:00
Joshua T Flowers 7aeb0a19d2 Migrate header items to slot fills (https://github.com/woocommerce/woocommerce-admin/pull/7805)
* Add SlotFill area to header

* Add activity panel fill

* Move activity panel to root client folder

* Move activity panel registration to its own folder

* Add navigation fill

* Add page title slotfill

* Slot fill the back button

* Move mobile banner to slot fill

* Fix navigation fill on embed pages

* Add changelog entry

* Allow order prop to header item fill

* Split header into before and after

* Fix header title gaps

* Fix nav and mobile app banner placement

* Fix display options import

* Only use last item for page header title fill

* Use function to pass fill props instead of bind

* Rename header slots

* Fix mobile banner dismissal check

* Fix up inbox panel rename

* Update task title in tests

* Fix up task status retrieval
2021-12-14 11:56:42 -05:00
louwie17 db29d8b571 Add loading icon and disable continue until free extensions are loaded (https://github.com/woocommerce/woocommerce-admin/pull/7979)
* Add loading icon and disable continue until free extensions are loaded.

* Add changelog

* Only show dropdown when we have installable extensions listed

* Revert spinner addition and add loading to Continue button

* Add wait for dropdown to be enabled
2021-12-03 11:03:44 -04:00
Adrian Duffell b9b4c82dca Make Homescreen Default to Single Column Layout (https://github.com/woocommerce/woocommerce-admin/pull/7969)
* Add database migration deleting layout option

* Remove calls to update the option

* Remove unused variable

* Add changelog

* Remove unused var (lint failure)

* Increase e2e test timeout to 1000

* Fix test: navigate to homescreen

Co-authored-by: Moon <moon.kyong@automattic.com>
2021-11-29 13:04:34 -08:00
Moon b41ab2f37f Fix the failing e2e test (https://github.com/woocommerce/woocommerce-admin/pull/7961)
* Wait 500ms after clicking Enable button
2021-11-23 15:13:10 -08:00
Joshua T Flowers 126707eeab Replace old task list option calls with data store selectors (https://github.com/woocommerce/woocommerce-admin/pull/7820)
* Add endpoint to unhide task list

* Rename show method to unhide

* Replace requests for hidden task list options

* Replace unhide task list requests

* Replace task list complete checks

* Replace dismiss option requests

* Remove complete task option check

* Fix up panel buttons

* Update finished setup to wait for task list resolution

* Create selector for getting a single task list

* Add selector for single task

* Fix task list panel visibility

* Add changelog entry

* Fix empty product types in profiler data

* Revert to checking for hidden task list
2021-11-15 15:57:13 -05:00
Fernando 9a2cd38004 Add tests to Subscriptions inclusion (https://github.com/woocommerce/woocommerce-admin/pull/7804)
* Add unit tests to `OnboardingProductTypes` REST API

* Add e2e tests

* Add changelog

* Fix e2e tests

* Fix test description

* Fix to clean payment methods

* Fixed `clickStartWithTemplate`

* Fix test description

* Add package changelog

Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
2021-11-04 10:15:42 -03:00
Ilyas Foo 29367e5f14 Fix typescript type error in admin-e2e-tests package (https://github.com/woocommerce/woocommerce-admin/pull/7765)
* Fix type error

* Update changelog

* Better type handlings
2021-10-23 11:03:24 +08:00
louwie17 a8a3238c38 Update E2E tests logic a bit (https://github.com/woocommerce/woocommerce-admin/pull/7769) 2021-10-13 08:36:19 -03:00
Taha Paksu 40cba3b0fb Add E2E tests for initial store currencies with different onboarding countries (https://github.com/woocommerce/woocommerce-admin/pull/7712)
* initial push

* Add E2E test for onboarding currency

* Wait for navigation to complete

* Change method for value check

* Fix dropdown selector

* Add more country tests

* Add changelog entry

* Add test to runner

* Change the call order

* Fix country specs

* Fix country specs for UK

* Try changelog again

* Move changelog record to e2e-tests

* Convert string concats to template literals

* Remove spaces

* Fix linter errors

* Add check for WCPay supported countries
2021-10-13 12:16:35 +08:00
Ilyas Foo cc1dab6e70 Bump admin-e2e-tests version to 0.1.2 (https://github.com/woocommerce/woocommerce-admin/pull/7764) 2021-10-07 13:05:40 +08:00
Ron Rennick 5a8a019465 restore closed overview sections before testing (https://github.com/woocommerce/woocommerce-admin/pull/7652)
* restore closed overview sections before testing

* add changelog entry
2021-10-06 13:24:10 -03:00
Ron Rennick c0759cdbe3 update waitFor calls to waitForFunction, waitForTimeout (https://github.com/woocommerce/woocommerce-admin/pull/7646)
* update waitFor calls to waitForFunction, waitForTimeout

* fix linting

* move waitForTimeout to general utility function
2021-10-06 11:07:09 -03:00
Ron Rennick 09a285cb52 add Customers page E2E test (https://github.com/woocommerce/woocommerce-admin/pull/7645) 2021-10-06 09:59:44 -03:00
Ilyas Foo 804116be18 Bump admin-e2e-tests version to 0.1.1 (https://github.com/woocommerce/woocommerce-admin/pull/7700)
* Bump admin-e2e-tests to 0.1.1

* Add missed changes to changelog
2021-09-23 20:10:10 +08:00
Ron Rennick f028d728fa allow CBD to be optional in business details in E2E (https://github.com/woocommerce/woocommerce-admin/pull/7675) 2021-09-17 10:55:29 -06:00
louwie17 4c4161ac3c Render psuedo wc pay payment gateway in payment method table (https://github.com/woocommerce/woocommerce-admin/pull/7550)
* Render psuedo wc pay payment gateway in payment method table

* Fix lint errors

* Fix lint error

* Add setup event and make use of script_assets file

* Left align payment icons

* Fix feature import and update pageview track

* Fix broken test and add an extra one

* Fix payment method ordering persistance

* Remove the use of psuedo and addressed several PR related feedback

* Fix PHP lint errors

* Make sure track props use underscore

* Fix test

* Update comment

* Add await
2021-09-08 13:41:00 -03:00
louwie17 e6cf391141 Make sure batch fetch resolved data remains consistent (https://github.com/woocommerce/woocommerce-admin/pull/7587)
* Adjust batch fetch logic so data stays the same

* Fix receive options action call

* Resolve returned result

* Add missing await
2021-09-08 09:37:44 -03:00
louwie17 4fb6841e40 Add task list and activity panel E2E tests (https://github.com/woocommerce/woocommerce-admin/pull/7509)
* Add hide and show task list tests

* The start to adding tests for the activity panel

* Add activity panel tests and WP-API plugin on initialize

* Update task list tests to be more flexible

* Add changelog in package

* Update the re-enable task list logic to be more robust

* Use a more generic selector

* Make sure task list is shown in previous test

* Add test screenshot

* Remove screenshot and update logic

* Address PR feedback
2021-09-03 08:21:43 -03:00
Joshua T Flowers 8f836c292f Create task list APIs (https://github.com/woocommerce/woocommerce-admin/pull/7577)
* Add endpoint to hide task lists

* Migrate old setup task list hidden option

* Use option to store all hidden lists

* Add getter for deprecated options

* Migrate old task list options

* Move task lists into separate class

* Add TaskList class for individual task list control

* Update hidden checks to use TaskList api

* Update docs for hidden lists

* Update use of should_show_tasks to check for visible task lists

* Remove hide endpoint to reduce scope on PR

* Fix up failing tests

* Fix up rebase

* Add back in should_show_tasks with deprecation notice

* Add delay between payment tests
2021-09-02 17:40:02 -04:00
Adrian Duffell 6d23ab7ea1 Add newsletter signup to profiler (https://github.com/woocommerce/woocommerce-admin/pull/7601)
* Add email address field to store details step in OBW (https://github.com/woocommerce/woocommerce-admin/pull/7552)

* Subscribe store_email to MailChimp (https://github.com/woocommerce/woocommerce-admin/pull/7579)

* Add prefill for email field in OBW (https://github.com/woocommerce/woocommerce-admin/pull/7570)

* Add error handling for email validation errors from backend (https://github.com/woocommerce/woocommerce-admin/pull/7590)

* Remove OnboardingEmailMarketing note class (https://github.com/woocommerce/woocommerce-admin/pull/7595)

Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>
Co-authored-by: Moon <moon.kyong@automattic.com>
2021-08-31 12:39:04 +08:00
Jeff Stieler d3e940208e Refactor package style builds (https://github.com/woocommerce/woocommerce-admin/pull/7531)
* Build experimental package CSS with webpack.

* Move style-only webpack config to reusable private package.

* Update other packages to use webpack for style builds.

* Add tsbuildinfo to clean scripts.

* Fix main start script.

* Remove defunct package build scripts.

* Move client/ dependencies for style builds.

* DRY.

* Remove defunct IE stylesheet definitions.

* Add missing RTL setup for onboarding styles.

* No need to export a function.

* Add changelog.

* Fix README.

* Revert concurrently script path change.
2021-08-19 10:15:59 -04:00
Joshua T Flowers 0ab7c7a3ec Remove the preloaded onboarding options (https://github.com/woocommerce/woocommerce-admin/pull/7338)
* Remove unused options

* Remove preloade tracking option

* Remove preloaded wc_connect_options

* Remove preloaded modal options

* Refactor requesting options into task list component

* Remove preloaded dismissed and completed tasks

* Add changelog entry

* Wait for modal before attempting to dismiss

* Attempt to make closing welcome modal more robust

* Update the payment E2E tests to support new app flow

* Update isResolving selectors to hasFinishedResolution

Co-authored-by: Lourens Schep <lourensschep@gmail.com>
2021-08-10 14:58:01 -04:00
Adrian Duffell 7abbc6942b Add rimraf dev dependency (https://github.com/woocommerce/woocommerce-admin/pull/7485) 2021-08-10 18:11:11 +08:00
Renovate Bot 05c378cbc9 Pin dependency jest-mock-extended to 1.0.18 2021-07-23 17:27:06 +00:00
louwie17 19714e8dc1 Add wildcard for element, given the element type is out of our control (https://github.com/woocommerce/woocommerce-admin/pull/7406) 2021-07-23 09:31:37 -03:00
Joshua T Flowers 8a040b99d9 Add scope to BACS slotfill (https://github.com/woocommerce/woocommerce-admin/pull/7405)
* Update e2e matcher for tasklist header

* Add scope to BACS slotfill

Co-authored-by: Lourens Schep <lourensschep@gmail.com>
2021-07-22 17:48:06 -04:00
Jeff Stieler 8e61f55017 Allow packages to be built in isolation. (https://github.com/woocommerce/woocommerce-admin/pull/7286)
* Use yarn instead of npm.

In prep for workspaces, since we're locked to npm < 7. See: https://github.com/woocommerce/woocommerce-admin/pull/7126#issue-661287749

* Initial workspace creation.

* Add initial tsc build to @woocommerce/number.

* Attempt to build experimental package.

* Try currency package.

* Define all packages as workspaces.

* Use tsconfig common to packages.

* Fix currency package build.

* Build csv-export with tsc.

* Try to build customer-effort-score with tsc.

* Fix JSX pragma.

* Build data package with tsc.

* Build date package with tsc.

* Build experimental package with tsc.

* Try to build explat package with tsc.

* Build navigation package with tsc.

* Build notices package with tsc.

* Build onboarding package with tsc.

* Build components package with tsc.

* Swap in package JS build into main script.

* Fix experimental package build.

* Try per-package css build with components.

* Try to run components package tests in isolation.

Broken on JSX in test files not being transformed.

* Move @woocommerce/wc-admin-settings into a package.

* Try to fix components package tests.

Fails because we aren't setting up the jest/jest-dom globals.

* Move JS test code to reusable (private) package.

* Enable incremental TS builds.

* Use workspaces to run JS tests.

* Use new jest configs for update snapshot scripts.

* Fix style builds.

* Fix package version in components.

* Fix client test debug and watch scripts.

* Update yarn lock.

* Update test-staged behavior.

* Try to fix storybook.

* Fix storybook.

* Update more npm commands to yarn.

* Add changelog.

* Fix lint errors.

* Update packages readme script references.

* Clean up unused gitignore match.

* Fix another npm command.

* Fix JS builds on watch.

* Fix start script.

* Fix start scripts for packages.

* Use tsc to build packages before tests

* yarn -> npm.

# Conflicts:
#	package-lock.json
#	package.json

* Fix linter error.

* Remove workspace definitions.

* Fix missing Fragment import.

* Fix package lock.

* Fix missing reference.

* Only build commonjs module for js-tests helper.

* Remove errant dependency from components.

* Remove noop scripts.

* Fix package JS build before testing.

* Revert noisy formatting changes.

* Fix precommit and test scripts.

* Fix minimum expected recommended extension count.

Japan test case breaks this.

* Revert babel config changes.

* chore(release): publish

 - @woocommerce/components@7.2.0
 - @woocommerce/csv-export@1.4.0
 - @woocommerce/currency@3.2.0
 - @woocommerce/customer-effort-score@1.1.0
 - @woocommerce/data@1.4.0
 - @woocommerce/date@3.1.0
 - @woocommerce/dependency-extraction-webpack-plugin@1.7.0
 - @woocommerce/eslint-plugin@1.3.0
 - @woocommerce/experimental@1.5.0
 - @woocommerce/explat@1.1.0
 - @woocommerce/js-tests@1.1.0
 - @woocommerce/navigation@6.1.0
 - @woocommerce/notices@3.1.0
 - @woocommerce/number@2.2.0
 - @woocommerce/onboarding@1.1.0
 - @woocommerce/tracks@1.1.0
 - @woocommerce/wc-admin-settings@1.1.0

* Add script for running 'start' in a package.

* Remove yarn from gitignore.

* Update package changelogs, prep versions for release.

* Try to fix E2E tests after main merge.

* Some cleanup.

* Add changelog.

Co-authored-by: Paul Sealock <psealock@gmail.com>
2021-07-14 16:38:57 -04:00
renovate[bot] 72cf95c51d Update dependency @types/expect-puppeteer to v4.4.6 (https://github.com/woocommerce/woocommerce-admin/pull/7346)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-07-14 15:23:59 +12:00
Ron Rennick 4af5eef27b Create E2E package (https://github.com/woocommerce/woocommerce-admin/pull/7084)
* bump E2E package versions to latest

* first pass on E2E test package.json

* move e2e specs to admin-e2e-tests

* add global types, reimplement tests/e2e/specs

* use consistent build dir with other packages

* add documentation, improve test:e2e script

* fix linting issues in admin-e2e-tests

* fix more linting issues

* disable lint on requires

* use e2e in the E2E container names

* move analytics overview test to package

* change extension on analytics-overview test file

* fix linting issues in e2e analytics overview

* remove package scripts from e2e package

* change test specs extensions to .tsx

* remove import from analytics overview test spec

* add .tsx to e2e test spec file extension list

* update e2e business features count expected
2021-07-13 16:38:05 -03:00