diff options
| author | XhmikosR <[email protected]> | 2021-07-29 09:14:40 +0300 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-07-29 09:14:40 +0300 |
| commit | ef5336373fc2431b3d1d37cde85cd262210a1dc6 (patch) | |
| tree | e325fb4c5532b464d05780c731d0f118f2a88d7f /js/tests/unit/base-component.spec.js | |
| parent | 62edf07d7491684fe67a9c1e9439ed2bd10ca741 (diff) | |
| parent | c6c0bbb0b67fe89b55740a63fd10d4ad79044970 (diff) | |
| download | bootstrap-main-fod-simpler-table-structure.tar.xz bootstrap-main-fod-simpler-table-structure.zip | |
Merge branch 'main' into main-fod-simpler-table-structuremain-fod-simpler-table-structure
Diffstat (limited to 'js/tests/unit/base-component.spec.js')
| -rw-r--r-- | js/tests/unit/base-component.spec.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/js/tests/unit/base-component.spec.js b/js/tests/unit/base-component.spec.js index 1000f2841..b8ec83f12 100644 --- a/js/tests/unit/base-component.spec.js +++ b/js/tests/unit/base-component.spec.js @@ -104,6 +104,20 @@ describe('Base Component', () => { expect(DummyClass.getInstance(element)).toBeInstanceOf(DummyClass) }) + it('should accept element, either passed as a CSS selector, jQuery element, or DOM element', () => { + createInstance() + + expect(DummyClass.getInstance('#foo')).toEqual(instance) + expect(DummyClass.getInstance(element)).toEqual(instance) + + const fakejQueryObject = { + 0: element, + jquery: 'foo' + } + + expect(DummyClass.getInstance(fakejQueryObject)).toEqual(instance) + }) + it('should return null when there is no instance', () => { fixtureEl.innerHTML = '<div></div>' |
