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
30e7df6c
Commit
30e7df6c
authored
4 years ago
by
XhmikosR
Browse files
Options
Download
Email Patches
Plain Diff
Backport
d59de33f
from #30772
Add a test about the scrollbar issue on non-integer width
parent
f1827ce9
v4-dev-dropdown-hide-method
v4-dev
v4.6.2
v4.6.1
v4.6.0
v4.5.3
v4.5.2
v4.5.1
v4.5.0
6 merge requests
!36532
My v4 dev
,
!34086
v4: Fix prevented show event disables modals with fade class from being displayed again
,
!33729
V4 dev
,
!33086
V4 dev
,
!31901
Add opacity utilities
,
!31513
Update icons.md
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
js/tests/unit/modal.js
+39
-0
js/tests/unit/modal.js
with
39 additions
and
0 deletions
+39
-0
js/tests/unit/modal.js
+
39
-
0
View file @
30e7df6c
...
...
@@ -745,6 +745,45 @@ $(function () {
}).
bootstrapModal
(
'
show
'
)
})
QUnit
.
test
(
'
should not adjust the inline body padding when it does not overflow, even on a scaled display
'
,
function
(
assert
)
{
assert
.
expect
(
1
)
var
done
=
assert
.
async
()
var
$modal
=
$
([
'
<div id="modal-test">
'
,
'
<div class="modal-dialog">
'
,
'
<div class="modal-content">
'
,
'
<div class="modal-body" />
'
,
'
</div>
'
,
'
</div>
'
,
'
</div>
'
].
join
(
''
)).
appendTo
(
'
#qunit-fixture
'
)
var
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
'
$modal
.
on
(
'
shown.bs.modal
'
,
function
()
{
var
currentPadding
=
window
.
getComputedStyle
(
document
.
body
).
paddingRight
assert
.
strictEqual
(
currentPadding
,
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
()
}).
bootstrapModal
(
'
show
'
)
})
QUnit
.
test
(
'
should enforce focus
'
,
function
(
assert
)
{
assert
.
expect
(
4
)
var
done
=
assert
.
async
()
...
...
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