Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Bootstrap
bootstrap
Commits
d59de33f
Commit
d59de33f
authored
4 years ago
by
Dominik Kremer
Committed by
XhmikosR
4 years ago
Browse files
Options
Download
Email Patches
Plain Diff
Add a test about the scrollbar issue on non-integer width
parent
3e7566f2
1 merge request
!31948
Examples/Floating-labels: fix bad behavior with autofill
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
js/tests/unit/modal.spec.js
+32
-0
js/tests/unit/modal.spec.js
with
32 additions
and
0 deletions
+32
-0
js/tests/unit/modal.spec.js
+
32
-
0
View file @
d59de33f
...
...
@@ -649,6 +649,38 @@ describe('Modal', () => {
modal
.
show
()
})
it
(
'
should not adjust the inline body padding when it does not overflow, even on a scaled display
'
,
done
=>
{
fixtureEl
.
innerHTML
=
'
<div class="modal"><div class="modal-dialog"></div></div>
'
const
modalEl
=
fixtureEl
.
querySelector
(
'
.modal
'
)
const
modal
=
new
Modal
(
modalEl
)
const
originalPadding
=
window
.
getComputedStyle
(
document
.
body
).
paddingRight
// Remove body margins as would be done by Bootstrap css
document
.
body
.
style
.
margin
=
'
0
'
// Hide scrollbars to prevent the body overflowing
document
.
body
.
style
.
overflow
=
'
hidden
'
// Simulate a discrepancy between exact, i.e. floating point body width, and rounded body width
// as it can occur when zooming or scaling the display to something else than 100%
document
.
documentElement
.
style
.
paddingRight
=
'
.48px
'
modalEl
.
addEventListener
(
'
shown.bs.modal
'
,
()
=>
{
const
currentPadding
=
window
.
getComputedStyle
(
document
.
body
).
paddingRight
expect
(
currentPadding
).
toEqual
(
originalPadding
,
'
body padding should not be adjusted
'
)
// Restore overridden css
document
.
body
.
style
.
removeProperty
(
'
margin
'
)
document
.
body
.
style
.
removeProperty
(
'
overflow
'
)
document
.
documentElement
.
style
.
paddingRight
=
'
16px
'
done
()
})
modal
.
show
()
})
it
(
'
should enforce focus
'
,
done
=>
{
fixtureEl
.
innerHTML
=
'
<div class="modal"><div class="modal-dialog"></div></div>
'
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets