Skip to content

GAUD-10486: add tests for dropdown scroll shadows - #7319

Merged
dlockhart merged 2 commits into
mainfrom
GAUD-10486/dropdown-recalc-shadows-tests
Aug 5, 2026
Merged

GAUD-10486: add tests for dropdown scroll shadows#7319
dlockhart merged 2 commits into
mainfrom
GAUD-10486/dropdown-recalc-shadows-tests

Conversation

@dlockhart

@dlockhart dlockhart commented Aug 5, 2026

Copy link
Copy Markdown
Member

When the content inside a dropdown overflows, shadows are displayed at the top and/or bottom to hint to the user that they can scroll.

However, if that content then changes after the fact to either cause scrolling when it wasn't there before or remove scrolling when it was, the shadows are not updated.

This PR simply adds vdiff tests to demonstrate the defect. I'll be doing a follow-up to fix it afterwards.

Vdiff Report

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Thanks for the PR! 🎉

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

URL https://live.d2l.dev/prs/BrightspaceUI/core/pr-7319/

Note

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

{ name: 'wide-opener', dropdownStyles: { left: '30px', right: '30px', top: '75px' }, openerStyles: { borderRadius: '5px', width: '100%' }, content: html`<d2l-dropdown-content opened>${basicText}</d2l-dropdown-content>` },
{ name: 'with-header-footer', allColorModes: true, content: html`<d2l-dropdown-content opened>${withHeaderFooter}</d2l-dropdown-content>` },
{ name: 'no-padding-no-pointer', content: html`<d2l-dropdown-content no-padding no-pointer opened>${basicText}</d2l-dropdown-content>` },
{ name: 'scroll-bottom-shadow', allColorModes: true, content: html`<d2l-dropdown-content opened>${scroll}</d2l-dropdown-content>` },

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Moved down below to group all the "shadow" vdiffs together. The test didn't change, it was just renamed to shadows-bottom.

await expect(document).to.be.golden({ allColorModes: true });
describe('shadows', () => {
[
{ name: 'both', allColorModes: true, initialContent: scroll, scrollTo: 75 },

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

New test showing shadows at the top and bottom.

{ name: 'bottom', allColorModes: true, initialContent: scroll },
{ name: 'top', allColorModes: true, initialContent: scroll, scrollTo: 1000 },
{ name: 'async-content-added', initialContent: 'Initial Content', asyncContent: scrollContent },
{ name: 'async-content-removed', initialContent: scroll, asyncContent: 'Updated' }

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

These two async tests demonstrate the defect.

content-added is the case where initially scrolling isn't required but is later added. A shadow at the bottom should be present but isn't.

content-removed is the case where initially scrolling is required but content is removed such that it's no longer required. A shadow is shown at the bottom when it shouldn't be.

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@dlockhart
dlockhart marked this pull request as ready for review August 5, 2026 18:21
@dlockhart
dlockhart requested a review from a team as a code owner August 5, 2026 18:21
@dlockhart
dlockhart merged commit 6b4af11 into main Aug 5, 2026
11 checks passed
@dlockhart
dlockhart deleted the GAUD-10486/dropdown-recalc-shadows-tests branch August 5, 2026 19:57
@d2l-github-release-tokens

Copy link
Copy Markdown

🎉 This PR is included in version 3.286.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

2 participants