diff options
author | Steffen Roßkamp <sr@blackblizzard.org> | 2019-10-31 08:58:09 +0300 |
---|---|---|
committer | XhmikosR <xhmikosr@gmail.com> | 2019-10-31 08:58:09 +0300 |
commit | c62efc3ef69d7dd6e784928b707f52884fab87de (patch) | |
tree | 022c4b52a410ef15290b78466a0681845c2b1f16 /js/tests | |
parent | 639c405c6510a286a3cfcfd6d733d28d0e7baf92 (diff) |
Update normalizeDataKey to match the spec (#29609)
Diffstat (limited to 'js/tests')
-rw-r--r-- | js/tests/unit/dom/manipulator.spec.js | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/js/tests/unit/dom/manipulator.spec.js b/js/tests/unit/dom/manipulator.spec.js index 986f692980..eec3ced52b 100644 --- a/js/tests/unit/dom/manipulator.spec.js +++ b/js/tests/unit/dom/manipulator.spec.js @@ -24,13 +24,13 @@ describe('Manipulator', () => { expect(div.getAttribute('data-key')).toEqual('value') }) - it('should set data attribute in lower case', () => { + it('should set data attribute in kebab case', () => { fixtureEl.innerHTML = '<div></div>' const div = fixtureEl.querySelector('div') - Manipulator.setDataAttribute(div, 'tEsT', 'value') - expect(div.getAttribute('data-test')).toEqual('value') + Manipulator.setDataAttribute(div, 'testKey', 'value') + expect(div.getAttribute('data-test-key')).toEqual('value') }) }) @@ -44,13 +44,13 @@ describe('Manipulator', () => { expect(div.getAttribute('data-key')).toBeNull() }) - it('should remove data attribute in lower case', () => { - fixtureEl.innerHTML = '<div data-testkey="value" ></div>' + it('should remove data attribute in kebab case', () => { + fixtureEl.innerHTML = '<div data-test-key="value"></div>' const div = fixtureEl.querySelector('div') - Manipulator.removeDataAttribute(div, 'tEStKeY') - expect(div.getAttribute('data-testkey')).toBeNull() + Manipulator.removeDataAttribute(div, 'testKey') + expect(div.getAttribute('data-test-key')).toBeNull() }) }) @@ -81,12 +81,12 @@ describe('Manipulator', () => { expect(Manipulator.getDataAttribute(div, 'test')).toBeNull() }) - it('should get data attribute in lower case', () => { - fixtureEl.innerHTML = '<div data-test="value" ></div>' + it('should get data attribute in kebab case', () => { + fixtureEl.innerHTML = '<div data-test-key="value" ></div>' const div = fixtureEl.querySelector('div') - expect(Manipulator.getDataAttribute(div, 'tEsT')).toEqual('value') + expect(Manipulator.getDataAttribute(div, 'testKey')).toEqual('value') }) it('should normalize data', () => { |