chromaui / addon-visual-tests

Visual Tests addon for Storybook
MIT License
33 stars 2 forks source link

When granting consent, immediately get access code rather than polling #116

Closed tmeasday closed 11 months ago

tmeasday commented 11 months ago

Using https://github.com/chromaui/chromatic/pull/7740, immediately on receiving the grant event, request a token from the server.

This partially solves AP-3549

📦 Published PR as canary version: 0.0.95--canary.116.adc0530.0
:sparkles: Test out this PR locally via: ```bash npm install @chromaui/addon-visual-tests@0.0.95--canary.116.adc0530.0 # or yarn add @chromaui/addon-visual-tests@0.0.95--canary.116.adc0530.0 ```
linear[bot] commented 11 months ago
AP-3549 Onboarding flow for new users to create a project

[https://www.figma.com/file/GFEbCgCVDtbZhngULbw2gP/Visual-testing-in-Storybook?type=design&node-id=1322-375121&mode=design&t=N1DXZ15edlIZ8rNJ-0](https://www.figma.com/file/GFEbCgCVDtbZhngULbw2gP/Visual-testing-in-Storybook?type=design&node-id=1322-375121&mode=design&t=N1DXZ15edlIZ8rNJ-0) As discussed with m - the basic flow is: 1. After signin / sign up 1. if a user is a member of project (either because they've used chromatic before or they are in an org with projects) 1. close the modal 2. show the project chooser 3. when chosen, go to step 4. 2. Otherwise, take them to the chromatic "create first project" onboarding screen 3. After they have created a project close the modal 4. Show the "project selected, now create first build" flow.

tmeasday commented 11 months ago

This all looks pretty solid. Some tests?

Fair question. I'm not sure exactly what to test though.

Basically there are two functions in this file that put together REST requests in a slightly complicated way. Do we want to snapshot the data on those requests? I'm not quite sure there's a lot of utility in that (people aren't going to know if the snapshot is "right" or not, so will probably blindly accept changes). Really the "test" is sending the request to the server and seeing if it's happy.

The second one does some error handling logic also, but TBH I think we might revisit that as it's a bit weird.

ghengeveld commented 11 months ago

I'm okay to leave the tests if there's no sensible strategy for it. Would be nice to have some E2E tests for this, eventually.

ghengeveld commented 11 months ago

It seems the stories are failing because they use the manager-api which isn't available in the preview.