Skip to content
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

Merged
merged 2 commits into from
Oct 13, 2021

Conversation

ZachJW34
Copy link
Contributor

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

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Oct 11, 2021

Thanks for taking the time to open a PR!

@lmiller1990 lmiller1990 self-requested a review October 12, 2021 06:36
Copy link
Contributor

@lmiller1990 lmiller1990 left a 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)
Copy link
Contributor

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?

Copy link
Contributor Author

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?
Copy link
Contributor

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...

Copy link
Contributor Author

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

@ZachJW34
Copy link
Contributor Author

@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.

@lmiller1990 lmiller1990 merged commit 7d141de into unified-desktop-gui Oct 13, 2021
tgriesser added a commit that referenced this pull request Oct 13, 2021
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants