Skip to content

Commit

Permalink
fix: close button static white
Browse files Browse the repository at this point in the history
  • Loading branch information
Rajdeep Chandra authored and Westbrook committed Aug 18, 2023
1 parent cff8aa8 commit d324017
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/toast/src/Toast.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ export class Toast extends FocusVisiblePolyfillMixin(SpectrumElement) {
<sp-close-button
@click=${this.shouldClose}
label="Close"
variant="white"
static="white"
></sp-close-button>
</div>
`;
Expand Down
15 changes: 15 additions & 0 deletions packages/toast/test/toast.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -308,4 +308,19 @@ describe('Toast', () => {
expect(el.open).to.be.true;
expect(closeSpy.callCount).to.equal(1);
});
it('sp close button renders with static="white"', async () => {
const el = await fixture<Toast>(
html`
<sp-toast open>Help text.</sp-toast>
`
);
const renderRoot = el.shadowRoot ? el.shadowRoot : el;
const closeButton = renderRoot.querySelector(
'sp-close-button'
) as CloseButton;

expect(closeButton).to.exist;

expect(closeButton.getAttribute('static')).to.equal('white');
});
});

0 comments on commit d324017

Please # to comment.