import { ListenerCounter } from '../lib/ListenerCounter.js' import { prepareStandardListeners } from '../lib/vdom-misc.js' describe('destroy', () => { describe('when calendar is LTR', () => { it('cleans up all classNames on the root element', () => { initCalendar({ direction: 'ltr', }) currentCalendar.destroy() expect(currentCalendar.el.className).toBe('') }) }) describe('when calendar is RTL', () => { it('cleans up all classNames on the root element', () => { initCalendar({ direction: 'rtl', }) currentCalendar.destroy() expect(currentCalendar.el.className).toBe('') }) }) describeOptions('themeSystem', { 'when bootstrap theme': 'bootstrap', }, () => { it('cleans up all classNames on the root element', () => { initCalendar() currentCalendar.destroy() expect(currentCalendar.el.className).toBe('') }) }) pushOptions({ initialDate: '2014-12-01', droppable: true, // likely to attach document handler editable: true, // same events: [ { title: 'event1', start: '2014-12-01' }, ], }) describeOptions('initialView', { 'when in dayGridWeek view': 'dayGridWeek', 'when in week view': 'timeGridWeek', 'when in listWeek view': 'listWeek', 'when in month view': 'dayGridMonth', }, (viewName) => { it('leaves no handlers attached to DOM', () => { const standardElListenerCount = prepareStandardListeners() let $el = $('