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
25ccd088
Commit
25ccd088
authored
3 years ago
by
GeoSot
Browse files
Options
Download
Email Patches
Plain Diff
change jQuery tests
parent
f5462d47
gs/streamline-jqueryInterface
1 merge request
!35489
Extract components jquery interface to an outer shareable function
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
js/tests/unit/jquery.spec.js
+31
-13
js/tests/unit/jquery.spec.js
with
31 additions
and
13 deletions
+31
-13
js/tests/unit/jquery.spec.js
+
31
-
13
View file @
25ccd088
...
...
@@ -12,11 +12,25 @@ import ScrollSpy from '../../src/scrollspy'
import
Tab
from
'
../../src/tab
'
import
Toast
from
'
../../src/toast
'
import
Tooltip
from
'
../../src/tooltip
'
import
{
get
Fixture
,
clear
Fixture
}
from
'
../helpers/fixture
'
import
{
clear
Fixture
,
get
Fixture
}
from
'
../helpers/fixture
'
import
{
getJqueryInterfaceForPlugin
}
from
'
../../src/util/jquery-stuff
'
describe
(
'
jQuery
'
,
()
=>
{
let
fixtureEl
const
plugins
=
[
Alert
,
Button
,
Carousel
,
Collapse
,
Dropdown
,
Modal
,
Offcanvas
,
Popover
,
ScrollSpy
,
Tab
,
Toast
,
Tooltip
]
beforeAll
(()
=>
{
fixtureEl
=
getFixture
()
...
...
@@ -27,18 +41,22 @@ describe('jQuery', () => {
})
it
(
'
should add all plugins in jQuery
'
,
()
=>
{
expect
(
getJqueryInterfaceForPlugin
(
Alert
)).
toEqual
(
jQuery
.
fn
.
alert
)
expect
(
getJqueryInterfaceForPlugin
(
Button
)).
toEqual
(
jQuery
.
fn
.
button
)
expect
(
getJqueryInterfaceForPlugin
(
Carousel
)).
toEqual
(
jQuery
.
fn
.
carousel
)
expect
(
getJqueryInterfaceForPlugin
(
Collapse
)).
toEqual
(
jQuery
.
fn
.
collapse
)
expect
(
getJqueryInterfaceForPlugin
(
Dropdown
)).
toEqual
(
jQuery
.
fn
.
dropdown
)
expect
(
getJqueryInterfaceForPlugin
(
Modal
)).
toEqual
(
jQuery
.
fn
.
modal
)
expect
(
getJqueryInterfaceForPlugin
(
Offcanvas
)).
toEqual
(
jQuery
.
fn
.
offcanvas
)
expect
(
getJqueryInterfaceForPlugin
(
Popover
)).
toEqual
(
jQuery
.
fn
.
popover
)
expect
(
getJqueryInterfaceForPlugin
(
ScrollSpy
)).
toEqual
(
jQuery
.
fn
.
scrollspy
)
expect
(
getJqueryInterfaceForPlugin
(
Tab
)).
toEqual
(
jQuery
.
fn
.
tab
)
expect
(
getJqueryInterfaceForPlugin
(
Toast
)).
toEqual
(
jQuery
.
fn
.
toast
)
expect
(
getJqueryInterfaceForPlugin
(
Tooltip
)).
toEqual
(
jQuery
.
fn
.
tooltip
)
for
(
const
plugin
of
plugins
)
{
getJqueryInterfaceForPlugin
(
plugin
)
}
expect
(
jQuery
.
fn
.
alert
).
toBeDefined
()
expect
(
jQuery
.
fn
.
button
).
toBeDefined
()
expect
(
jQuery
.
fn
.
carousel
).
toBeDefined
()
expect
(
jQuery
.
fn
.
collapse
).
toBeDefined
()
expect
(
jQuery
.
fn
.
dropdown
).
toBeDefined
()
expect
(
jQuery
.
fn
.
modal
).
toBeDefined
()
expect
(
jQuery
.
fn
.
offcanvas
).
toBeDefined
()
expect
(
jQuery
.
fn
.
popover
).
toBeDefined
()
expect
(
jQuery
.
fn
.
scrollspy
).
toBeDefined
()
expect
(
jQuery
.
fn
.
tab
).
toBeDefined
()
expect
(
jQuery
.
fn
.
toast
).
toBeDefined
()
expect
(
jQuery
.
fn
.
tooltip
).
toBeDefined
()
})
it
(
'
should use jQuery event system
'
,
()
=>
{
...
...
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