From e530118117af509ffb97029cd250a23ee08120b6 Mon Sep 17 00:00:00 2001 From: Rohit Sharma Date: Wed, 11 Nov 2020 12:07:04 +0530 Subject: Get only bs prefixed data attributes --- js/tests/unit/dom/manipulator.spec.js | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) (limited to 'js/tests') diff --git a/js/tests/unit/dom/manipulator.spec.js b/js/tests/unit/dom/manipulator.spec.js index 747e8bfd7..4f5ef715e 100644 --- a/js/tests/unit/dom/manipulator.spec.js +++ b/js/tests/unit/dom/manipulator.spec.js @@ -60,32 +60,16 @@ describe('Manipulator', () => { expect().nothing() }) - it('should get all data attributes, without bs prefixed as well', () => { - fixtureEl.innerHTML = '
' + it('should get only bs prefixed data attributes without bs namespace', () => { + fixtureEl.innerHTML = '
' const div = fixtureEl.querySelector('div') expect(Manipulator.getDataAttributes(div)).toEqual({ - bsToggle: 'tabs', - bsTarget: '#element', - another: 'value', toggle: 'tabs', target: '#element' }) }) - - it('should remove just prefixed bs keyword from the attributes and override original attribute with bs prefixed', () => { - fixtureEl.innerHTML = '
' - - const div = fixtureEl.querySelector('div') - - expect(Manipulator.getDataAttributes(div)).toEqual({ - bsToggle: 'tabs', - targetBs: '#element', - inBsOut: 'in-between', - toggle: 'tabs' - }) - }) }) describe('getDataAttribute', () => { -- cgit v1.2.3