Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohann-S <johann.servoire@gmail.com>2019-09-04 17:58:29 +0300
committerXhmikosR <xhmikosr@gmail.com>2020-11-29 21:58:26 +0300
commit9f6b342dc710e4334b37ded90136efa1127a47cd (patch)
treecb5d8c8bddf356dd3f8c2289b99e9f9793fba6c7 /js/tests/unit/scrollspy.spec.js
parentc63aebc86ba05f0ebb420add653b80804c6a0cff (diff)
create a base component
Diffstat (limited to 'js/tests/unit/scrollspy.spec.js')
-rw-r--r--js/tests/unit/scrollspy.spec.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/js/tests/unit/scrollspy.spec.js b/js/tests/unit/scrollspy.spec.js
index 33298300cf..303a336f44 100644
--- a/js/tests/unit/scrollspy.spec.js
+++ b/js/tests/unit/scrollspy.spec.js
@@ -634,6 +634,16 @@ describe('ScrollSpy', () => {
})
describe('getInstance', () => {
+ it('should return scrollspy instance', () => {
+ fixtureEl.innerHTML = '<div></div>'
+
+ const div = fixtureEl.querySelector('div')
+ const scrollSpy = new ScrollSpy(div)
+
+ expect(ScrollSpy.getInstance(div)).toEqual(scrollSpy)
+ expect(ScrollSpy.getInstance(div) instanceof ScrollSpy).toEqual(true)
+ })
+
it('should return null if there is no instance', () => {
expect(ScrollSpy.getInstance(fixtureEl)).toEqual(null)
})