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

US152268 - Hookup new vdiff tests and migrate dialog #3892

Merged
merged 12 commits into from
Aug 23, 2023

Conversation

svanherk
Copy link
Contributor

@svanherk svanherk commented Aug 14, 2023

This PR:

  • Hooks up a new vdiff workflow
  • Migrates the existing dialog, dialog-fullscreen, dialog-mixin and dialog-with-mobile-dropdown tests over
    • The remaining dialog-confirm and dialog-ifrau are different enough that there wasn't much benefit lumping them with these four

@github-actions
Copy link
Contributor

Thanks for the PR! 🎉

We've deployed an automatic preview for this PR - you can see your changes here:

URL https://pr-3892-brightspace-ui-core.d2l.dev/

Note
The build needs to finish before your changes are deployed.
Changes to the PR will automatically update the instance.

@svanherk svanherk marked this pull request as ready for review August 14, 2023 23:00
@svanherk svanherk requested a review from a team as a code owner August 14, 2023 23:00
@github-actions
Copy link
Contributor

Thanks for the PR! 🎉

We've deployed an automatic preview for this PR - you can see your changes here:

URL https://pr-3892-brightspace-ui-core.d2l.dev/

Note
The build needs to finish before your changes are deployed.
Changes to the PR will automatically update the instance.

Copy link
Contributor Author

@svanherk svanherk left a comment

Choose a reason for hiding this comment

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

Ok, this is ready for final review! The image diffs here were done in stages:

  1. Migrate existing images from /screenshots/ci -> golden
  2. Run tests against old images and create useful report to compare
  3. Merge in changes

But what that ends up looking like all combined is a diff that deletes the old images and adds slightly different new ones. The easiest way to compare the diffs will be to look at the final report in #3893

@@ -1,4 +1,5 @@
* @BrightspaceUI/gaudi-dev
helpers/getLocalizeResources.js @BrightspaceUI/team-usa-devs @BrightspaceUI/team-usa-senior-devs
golden/
.vdiff.json
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We need to add this so a CODEOWNERS review is not required for vdiff PRs

@@ -1,6 +1,7 @@
build/
generated/
node_modules/
.vdiff/
components/*/test/screenshots/current/
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can clean these all up after the last old-visual-diff-style tests are migrated


describe('dialog-fullscreen', () => {

[/*'native',*/ 'custom'].forEach((type) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

As discussed, we're going to turn off the native tests for now since they're just duplicates of the custom images. But the test file is still setup to properly detect it, and if we want to turn them on again someday we would:

  1. Uncomment this line and run the tests to get a baseline
  2. Turn native dialogs back on to see the differences between it and custom

@svanherk svanherk changed the title Hookup new dialog vdiff tests US152268 - Hookup new vdiff tests and migrate dialog Aug 23, 2023
Copy link
Member

@dlockhart dlockhart left a comment

Choose a reason for hiding this comment

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

Looks great! Just a couple notes. It's fantastic how readable the report is.

{ name: 'no-padding', template: createDialog({ content: html`<div style="background-color: var(--d2l-color-citrine); height: 100%; width: 100%;">No padding!</div>${footer}`, noPadding: true }) },
{ name: 'horizontal-overflow', template: createDialog({ content: html`${tabs}${general}` }) },
{ name: 'scroll-bottom-shadow', template: createDialog({ content: html`${long}${footer}` }) },
{ name: 'scroll-top-shadow', template: createDialog({ content: html`${long}${footer}` }), action: elem => elem.querySelector('#bottom').scrollIntoView() },
Copy link
Member

Choose a reason for hiding this comment

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

Was wondering why this resulted in a diff... so previously #dialogLong went to "Line 12" but your ${long} has 13 lines. Same thing happened in the dialog.vdiff.js 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.

Yeah I should've called that out, I figured it wasn't worth adding another option in dialog-shared-contents.js to export or creating a one-off template just to have one less line

Copy link
Member

Choose a reason for hiding this comment

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

Cool yeah, just wanted to make sure you did it consciously.

@svanherk svanherk merged commit de43af0 into main Aug 23, 2023
@svanherk svanherk deleted the Hookup_new_dialog_vdiff_tests branch August 23, 2023 19:50
@ghost
Copy link

ghost commented Aug 23, 2023

🎉 This PR is included in version 2.141.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@ghost ghost added the released label Aug 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants