mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-18 11:21:23 +02:00
Add tests for DATA_KEY
(#33090)
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
This commit is contained in:
@@ -19,6 +19,12 @@ describe('Alert', () => {
|
|||||||
expect(typeof Alert.VERSION).toEqual('string')
|
expect(typeof Alert.VERSION).toEqual('string')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
describe('DATA_KEY', () => {
|
||||||
|
it('should return plugin data key', () => {
|
||||||
|
expect(Alert.DATA_KEY).toEqual('bs.alert')
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
describe('data-api', () => {
|
describe('data-api', () => {
|
||||||
it('should close an alert without instantiating it manually', () => {
|
it('should close an alert without instantiating it manually', () => {
|
||||||
fixtureEl.innerHTML = [
|
fixtureEl.innerHTML = [
|
||||||
|
@@ -24,6 +24,12 @@ describe('Button', () => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
describe('DATA_KEY', () => {
|
||||||
|
it('should return plugin data key', () => {
|
||||||
|
expect(Button.DATA_KEY).toEqual('bs.button')
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
describe('data-api', () => {
|
describe('data-api', () => {
|
||||||
it('should toggle active class on click', () => {
|
it('should toggle active class on click', () => {
|
||||||
fixtureEl.innerHTML = [
|
fixtureEl.innerHTML = [
|
||||||
|
@@ -45,6 +45,12 @@ describe('Carousel', () => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
describe('DATA_KEY', () => {
|
||||||
|
it('should return plugin data key', () => {
|
||||||
|
expect(Carousel.DATA_KEY).toEqual('bs.carousel')
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
describe('constructor', () => {
|
describe('constructor', () => {
|
||||||
it('should go to next item if right arrow key is pressed', done => {
|
it('should go to next item if right arrow key is pressed', done => {
|
||||||
fixtureEl.innerHTML = [
|
fixtureEl.innerHTML = [
|
||||||
|
@@ -27,6 +27,12 @@ describe('Collapse', () => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
describe('DATA_KEY', () => {
|
||||||
|
it('should return plugin data key', () => {
|
||||||
|
expect(Collapse.DATA_KEY).toEqual('bs.collapse')
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
describe('constructor', () => {
|
describe('constructor', () => {
|
||||||
it('should allow jquery object in parent config', () => {
|
it('should allow jquery object in parent config', () => {
|
||||||
fixtureEl.innerHTML = [
|
fixtureEl.innerHTML = [
|
||||||
|
@@ -33,6 +33,12 @@ describe('Dropdown', () => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
describe('DATA_KEY', () => {
|
||||||
|
it('should return plugin data key', () => {
|
||||||
|
expect(Dropdown.DATA_KEY).toEqual('bs.dropdown')
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
describe('constructor', () => {
|
describe('constructor', () => {
|
||||||
it('should add a listener on trigger which do not have data-bs-toggle="dropdown"', () => {
|
it('should add a listener on trigger which do not have data-bs-toggle="dropdown"', () => {
|
||||||
fixtureEl.innerHTML = [
|
fixtureEl.innerHTML = [
|
||||||
|
@@ -56,6 +56,12 @@ describe('Modal', () => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
describe('DATA_KEY', () => {
|
||||||
|
it('should return plugin data key', () => {
|
||||||
|
expect(Modal.DATA_KEY).toEqual('bs.modal')
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
describe('toggle', () => {
|
describe('toggle', () => {
|
||||||
it('should toggle a modal', done => {
|
it('should toggle a modal', done => {
|
||||||
fixtureEl.innerHTML = '<div class="modal"><div class="modal-dialog"></div></div>'
|
fixtureEl.innerHTML = '<div class="modal"><div class="modal-dialog"></div></div>'
|
||||||
|
@@ -47,6 +47,12 @@ describe('ScrollSpy', () => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
describe('DATA_KEY', () => {
|
||||||
|
it('should return plugin data key', () => {
|
||||||
|
expect(ScrollSpy.DATA_KEY).toEqual('bs.scrollspy')
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
describe('constructor', () => {
|
describe('constructor', () => {
|
||||||
it('should generate an id when there is not one', () => {
|
it('should generate an id when there is not one', () => {
|
||||||
fixtureEl.innerHTML = [
|
fixtureEl.innerHTML = [
|
||||||
|
@@ -20,6 +20,12 @@ describe('Toast', () => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
describe('DATA_KEY', () => {
|
||||||
|
it('should return plugin data key', () => {
|
||||||
|
expect(Toast.DATA_KEY).toEqual('bs.toast')
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
describe('constructor', () => {
|
describe('constructor', () => {
|
||||||
it('should allow to config in js', done => {
|
it('should allow to config in js', done => {
|
||||||
fixtureEl.innerHTML = [
|
fixtureEl.innerHTML = [
|
||||||
|
Reference in New Issue
Block a user