import Collapse from '../../src/collapse' import EventHandler from '../../src/dom/event-handler' /** Test helpers */ import { clearFixture, getFixture, jQueryMock } from '../helpers/fixture' describe('Collapse', () => { let fixtureEl beforeAll(() => { fixtureEl = getFixture() }) afterEach(() => { clearFixture() }) describe('VERSION', () => { it('should return plugin version', () => { expect(Collapse.VERSION).toEqual(jasmine.any(String)) }) }) describe('Default', () => { it('should return plugin default config', () => { expect(Collapse.Default).toEqual(jasmine.any(Object)) }) }) describe('DATA_KEY', () => { it('should return plugin data key', () => { expect(Collapse.DATA_KEY).toEqual('bs.collapse') }) }) describe('constructor', () => { it('should take care of element either passed as a CSS selector or DOM element', () => { fixtureEl.innerHTML = '
' const collapseEl = fixtureEl.querySelector('div.my-collapse') const collapseBySelector = new Collapse('div.my-collapse') const collapseByElement = new Collapse(collapseEl) expect(collapseBySelector._element).toEqual(collapseEl) expect(collapseByElement._element).toEqual(collapseEl) }) it('should allow jquery object in parent config', () => { fixtureEl.innerHTML = [ '