-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: create a copy when selecting a pre-existing story #18440
Conversation
Thanks for taking the time to open a PR!
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor comments, but looks good. I did not give it a test locally, I wonder if we can find some more streamlined way to make this feature quick and easy to test.
If you pull in the latest changes from unified-desktop-gui I think you should be able to see the stories in the new Runner UI (open the app and go to the localhost:{port}/__vite__/
endpoint) and click the spec?
What is the next step for integrating this in the main launchpad/runner workflow?
} | ||
) | ||
|
||
await this.ctx.fs.outputFileSync(newSpecAbsolute, newSpecContent) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure we need to await outputFileSync
- does this return a Promise
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should have been outputFile
!
|
||
const parsedNewSpec = path.parse(newSpecAbsolute) | ||
|
||
// Can this be obtained from the spec watcher? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We definitely need some kind of centralized spec watching module at some point, we have chokidars all over the place...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I imagine we could wire into the default spec watcher and wait for it to pick up this new spec but there is some complexity there that I didn't think was worth adding yet
@lmiller1990 The next step for integration will be picked up by Jess as she builds out the UI for this. I would love to add some e2e tests for this feature but I've been hesitant since testing of the app and launchpad flow has been changing so much. I think an e2e test against a cra app with storybook installed would be great, as it could test the whole flow of story detection to spec generation. |
344c9b4
to
03fce32
Compare
…ramework * unified-desktop-gui: fix conflicts fix conflicts feat: create a copy when selecting a pre-existing story (#18440) feat: add configured state to TestingTypeCard (#18461) feat(app): run e2e tests (#18448) fix: frontend-shared typo on windi config feat: make the select language component (#18443) chore: Update Chrome (stable) to 94.0.4606.81 (#18411) release 8.6.0 fix: do not attempt to trim objects when printing to console (#18341) fix(driver): `cy.pause()` should not be ignored with `cypress run --headed --no-exit` (#18358) chore: release @cypress/vite-dev-server-v2.1.1 chore: release @cypress/react-v5.10.1
This PR changes the behavior of story generation such that when generating a spec from a story that already exists, a copy of the file will be created rather than a no-op. Also did some small refactoring so that the file generation and story parsing are separated which will be useful later on when file->spec generation is more generic.
Testing is still a bit of a chore, but you can follow the description from this PR to get Storybook setup for a create-react-app.
Screen.Recording.2021-10-11.at.11.57.46.AM.mov