diff options
| author | Johann-S <[email protected]> | 2019-09-04 17:58:29 +0300 |
|---|---|---|
| committer | XhmikosR <[email protected]> | 2020-11-29 20:58:26 +0200 |
| commit | 9f6b342dc710e4334b37ded90136efa1127a47cd (patch) | |
| tree | cb5d8c8bddf356dd3f8c2289b99e9f9793fba6c7 /js/tests/unit/scrollspy.spec.js | |
| parent | c63aebc86ba05f0ebb420add653b80804c6a0cff (diff) | |
| download | bootstrap-9f6b342dc710e4334b37ded90136efa1127a47cd.tar.xz bootstrap-9f6b342dc710e4334b37ded90136efa1127a47cd.zip | |
create a base component
Diffstat (limited to 'js/tests/unit/scrollspy.spec.js')
| -rw-r--r-- | js/tests/unit/scrollspy.spec.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/js/tests/unit/scrollspy.spec.js b/js/tests/unit/scrollspy.spec.js index 33298300c..303a336f4 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) }) |
