Skip to content

Commit 9f7702e

Browse files
authored
add a few istanbul ignore statements for branching that can't be tested in JSDOM
1 parent a7fb0b3 commit 9f7702e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/components/modal/modal.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -708,11 +708,13 @@ export default {
708708
}
709709
const modal = this.$refs.modal
710710
const isModalOverflowing = modal.scrollHeight > document.documentElement.clientHeight
711+
/* istanbul ignore if: can't test in JSDOM */
711712
if (!this.isBodyOverflowing && isModalOverflowing) {
712713
modal.style.paddingLeft = `${this.scrollbarWidth}px`
713714
} else {
714715
modal.style.paddingLeft = ''
715716
}
717+
/* istanbul ignore else: can't test in JSDOM */
716718
if (this.isBodyOverflowing && !isModalOverflowing) {
717719
modal.style.paddingRight = `${this.scrollbarWidth}px`
718720
} else {
@@ -780,6 +782,7 @@ export default {
780782
if (body._paddingChangedForModal) {
781783
// Restore fixed content padding
782784
body._paddingChangedForModal.forEach(el => {
785+
/* istanbul ignore next: can't test in JSDOM */
783786
if (hasAttr(el, 'data-padding-right')) {
784787
el.style.paddingRight = getAttr(el, 'data-padding-right') || ''
785788
removeAttr(el, 'data-padding-right')
@@ -789,6 +792,7 @@ export default {
789792
if (body._marginChangedForModal) {
790793
// Restore sticky content and navbar-toggler margin
791794
body._marginChangedForModal.forEach(el => {
795+
/* istanbul ignore next: can't test in JSDOM */
792796
if (hasAttr(el, 'data-margin-right')) {
793797
el.style.marginRight = getAttr(el, 'data-margin-right') || ''
794798
removeAttr(el, 'data-margin-right')

0 commit comments

Comments
 (0)