From e88563dd055ef3f4f1e609766644a95b5b3e0603 Mon Sep 17 00:00:00 2001 From: Allan Xiao Date: Tue, 31 May 2022 16:32:17 -0700 Subject: [PATCH 1/2] fix: Update default Modal heading element to h1 --- components/modal/__tests__/modal.browser-test.jsx | 5 +++++ components/modal/index.jsx | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/components/modal/__tests__/modal.browser-test.jsx b/components/modal/__tests__/modal.browser-test.jsx index 6f4c6ecc02..308c55f923 100644 --- a/components/modal/__tests__/modal.browser-test.jsx +++ b/components/modal/__tests__/modal.browser-test.jsx @@ -234,6 +234,11 @@ describe('SLDSModal: ', function () { modal = getModalNode(document.body); }); + it('adds the default h1 heading element', () => { + const header = modal.querySelector('.slds-modal__header h1'); + expect(header).to.not.be.null; + }); + it('adds the footer', () => { const footer = modal.querySelector('.slds-modal__footer'); expect(footer.className).to.include('slds-theme_default'); diff --git a/components/modal/index.jsx b/components/modal/index.jsx index 9e9487a577..9aa58b1453 100644 --- a/components/modal/index.jsx +++ b/components/modal/index.jsx @@ -449,7 +449,7 @@ class Modal extends React.Component { headerContent = (
{this.props.toast} -

{this.props.heading ? this.props.heading : this.props.title} -

+ {this.props.tagline ? (

{this.props.tagline}

) : null} From 6ad943909ea1b4cc0a8c9797ad14a9e2b76044f3 Mon Sep 17 00:00:00 2001 From: Allan Xiao Date: Tue, 31 May 2022 16:43:29 -0700 Subject: [PATCH 2/2] add section check --- components/modal/__tests__/modal.browser-test.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/modal/__tests__/modal.browser-test.jsx b/components/modal/__tests__/modal.browser-test.jsx index 308c55f923..b104b2911b 100644 --- a/components/modal/__tests__/modal.browser-test.jsx +++ b/components/modal/__tests__/modal.browser-test.jsx @@ -235,7 +235,7 @@ describe('SLDSModal: ', function () { }); it('adds the default h1 heading element', () => { - const header = modal.querySelector('.slds-modal__header h1'); + const header = modal.querySelector('section .slds-modal__header h1'); expect(header).to.not.be.null; });