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: add spec pattern modal #19801

Merged
merged 16 commits into from
Jan 28, 2022
Merged

feat: add spec pattern modal #19801

merged 16 commits into from
Jan 28, 2022

Conversation

ZachJW34
Copy link
Contributor

User facing changelog

Clicking the "Matches" indicator on the spec list brings up spec pattern modal

Additional details

Also updates the styles of the indicator now that it is actionable.

How has the user experience changed?

Screen Shot 2022-01-20 at 4 54 25 PM

PR Tasks

  • Have tests been added/updated?
  • [na] Has the original issue (or this PR, if no issue exists) been tagged with a release in ZenHub? (user-facing changes only)
  • [na] Has a PR for user-facing changes been opened in cypress-documentation?
  • [na] Have API changes been updated in the type definitions?
  • [na] Have new configuration options been added to the cypress.schema.json?

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Jan 20, 2022

Thanks for taking the time to open a PR!

@cypress
Copy link

cypress bot commented Jan 20, 2022



Test summary

17937 0 216 0Flakiness 2


Run details

Project cypress
Status Passed
Commit 9f47eee
Started Jan 28, 2022 4:31 PM
Ended Jan 28, 2022 4:43 PM
Duration 12:11 💡
OS Linux Debian - 10.10
Browser Multiple

View run in Cypress Dashboard ➡️


Flakiness

cypress/e2e/commands/net_stubbing.cy.ts Flakiness
1 network stubbing > waiting and aliasing > can timeout waiting on a single request using "alias.request"
2 network stubbing > waiting and aliasing > can timeout waiting on a single request using "alias.request"

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

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.

one question but looks great!

@spec-pattern="bindingsOpen = true"
/>
<SpecPatternModal
v-if="props.gql.currentProject && bindingsOpen"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we combine the v-if and :show? It looks like they do same thing (conditionally hide/show?)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think they have different purposes here. It might be better to make the v-if depend just on props.gql.currentProject so that the SpecPatternModal component renders only once, when there is a currentProject, and keep bindingsOpen to only manage the open/closed state. With the current v-if we add/remove the component from the DOM, at the same time as we are opening and closing the modal.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@marktnoonan I'll implement what you've stated above, and also rename some variables as bindingsOpen was a copy and paste and it should be named more contextually.

@lmiller1990 lmiller1990 self-requested a review January 25, 2022 00:06
lmiller1990
lmiller1990 previously approved these changes Jan 25, 2022
@lmiller1990
Copy link
Contributor

LGTM, I will leave merging to @ZachJW34 - might be good to re-run CI, just to see if it's flake or real fails.

@ZachJW34
Copy link
Contributor Author

@lmiller1990 thanks for the review. There is a PR that was going to clash with this one that was a higher priority so I'm letting this sit until it's merged and I'll fix it up

marktnoonan
marktnoonan previously approved these changes Jan 27, 2022
Copy link
Contributor

@marktnoonan marktnoonan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works great. I see some alignment issues in a couple of components when I look at them on my machine, but not sure they come from this PR.

One comment on an accessibility update you could make with the button, but I'm in a similar part of the code in my next PR so happy to make it then and get this merged if you like.

Screen Shot 2022-01-27 at 11 08 35 AM
Screen Shot 2022-01-27 at 11 07 06 AM

<span
class="block border-l h-24px px-16px border-l-gray-100 group-hover:border-none"
>
{{ resultCount }} {{ resultCount === 1 ? t('specPage.matchSingular') : t('specPage.matchPlural') }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{{ resultCount }} {{ resultCount === 1 ? t('specPage.matchSingular') : t('specPage.matchPlural') }}
{{ resultCount }} {{ resultCount === 1 ? t('specPage.matchSingular') : t('specPage.matchPlural') }}
<span class="sr-only">{{ t(`createSpec.viewSpecPatternButton`) }} </span>

If we add an sr-only span here, it will give the button a useful label for screen readers, and we can replace .get('[data-cy="open-spec-pattern-modal"]') with something like cy.contains('button', 'View spec pattern') in tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated! I noticed alignment issues as well but they disappeared and I can't reproduce them. Could have been a new class that wasn't picked up if yarn dev was still running?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that sounds right!

Copy link
Contributor

@elevatebart elevatebart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in azure there was a status Approved with comments... that is what I want here.
Not perfect but should go in.

Comment on lines +10 to 15
<SpecPatternModal
v-if="props.gql.currentProject"
:show="showSpecPatternModal"
:gql="props.gql.currentProject"
@close="showSpecPatternModal = false"
/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like this should be added to the top component.
Then the trigger would be through a global store variable.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

less repetition for something that global

@ZachJW34 ZachJW34 merged commit 03e428f into 10.0-release Jan 28, 2022
@ZachJW34 ZachJW34 deleted the view-spec-pattern-modal branch January 28, 2022 16:52
tgriesser added a commit that referenced this pull request Jan 31, 2022
* 10.0-release: (25 commits)
  fix(unify): improve dev server config ergonomics (#19957)
  feat: add spec pattern modal (#19801)
  fix: Windows e2e project scaffolding issues (#19938)
  feat: update @cypress/schematic to use proper e2e config for 10.0.0 (#19827)
  fix: correctly migrate projects with custom integration folder (#19929)
  fix: component spec creation with spec pattern (#19862)
  fix: missed committing yarn.lock after merge conflict
  fix: correct reference branch / commitSha in performance-reporter (#19941)
  feat: update navbar UI per Figma (#19926)
  fix: seed examples files when no e2e directory is created (#19768)
  chore: remove windy lightBlue warning
  test: component test updates (#19925)
  feat: Focus browser from select browser screen and on dashboard login (#19842)
  test: Honeycomb system-test reporter (#19855)
  fix(deps): update dependency engine.io to v5.2.1 [security]
  feat: Retain fileName when working with aliased fixtures and files (#19820)
  Update release-process.md
  Update release-process.md
  Update release-process.md
  Update release-process.md
  ...
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.

4 participants