* Update the design of the sonner toasts. Add the close button by default. * Migrate studio and www apps to use the SonnerToaster. * Migrate all toasts from studio. * Migrate all leftover toasts in studio. * Add a new toast component with progress. Use it in studio. * Migrate the design-system app. * Refactor the consent toast to use sonner. * Switch docs to use the new sonner toasts. * Remove toast examples from the design-system app. * Remove all toast-related components and old code. * Fix the progress bar in the toast progress component. Also make the bottom components vertically centered. * Fix the width of the toast progress. * Use text-foreground-lighter instead of muted for ToastProgress text * Rename ToastProgress to SonnerProgress. * Shorten the text in sonner progress. * Use the correct classes for the close button. Add a const var for the default toast duration. Remove the custom width class from sonner. * Set the position for all progress toasts to bottom right. Set the duration for all toasts to the default (when reusing a toast id from loading/progress toast, the duration is set to infinity). * Fix the playwright tests. * Refactor imports to use ui instead of @ui. * Change all imports of react-hot-toast with sonner. These components were merged since the last commit to this branch. * Remove react-hot-toast lib. --------- Co-authored-by: Joshen Lim <joshenlimek@gmail.com> Co-authored-by: Jonathan Summers-Muir <MildTomato@users.noreply.github.com>
Local studio tests
In an effort to make the local studio more stable, we've added tests which test features which are commonly used in local development. Built with Playwright.
How to run tests
Before running the tests, make sure you've done the following:
- Run
npm installin the root folder of this repo dockerororbstackis currently runningsupabaseCLI is already installed- no other supabase local environment is running (infrastructure environment is ok)
You can run the tests by running npm run test in this folder.
When you run the command, it includes:
- Setting up the local environment using the
supabaseCLI - Extracting the environment variables and saving them into a
.env.testfile in the studio app - Running the
studioapp in dev mode (npm run dev) - Running the tests
- Stopping the
studioapp and the local environment
If the environment does't stop for some reason, you'll see supabase start is already running on the next run. In this
case, just run supabase stop between test runs.
How to write tests
Playwright has a nice Codegen tool which you can use to record your actions:
npm run codegen:setup
# in a separate terminal
npm run codegen
How to debug/fix tests
If you've run the tests locally and you want to see the results, Playwright has a UI mode which you can use to run and replay specific tests:
npm run test -- --ui
It will also record any failing tests when running npm run test in this folder.