source: frontend/node_modules/eslint-plugin-jsx-a11y/__tests__/src/util/isContentEditable-test.js

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 2 weeks ago

Fix frontend appearance

  • Property mode set to 100644
File size: 1.3 KB
Line 
1import test from 'tape';
2
3import isContentEditable from '../../../src/util/isContentEditable';
4import JSXAttributeMock from '../../../__mocks__/JSXAttributeMock';
5
6test('isContentEditable - HTML5', (t) => {
7 t.equal(
8 isContentEditable('some tag', [
9 JSXAttributeMock('contentEditable', 'true'),
10 ]),
11 true,
12 'identifies HTML5 contentEditable elements',
13 );
14
15 t.test('not content editable', (st) => {
16 st.equal(
17 isContentEditable('some tag', [
18 JSXAttributeMock('contentEditable', null),
19 ]),
20 false,
21 'does not identify HTML5 content editable elements with null as the value',
22 );
23
24 st.equal(
25 isContentEditable('some tag', [
26 JSXAttributeMock('contentEditable', undefined),
27 ]),
28 false,
29 'does not identify HTML5 content editable elements with undefined as the value',
30 );
31
32 st.equal(
33 isContentEditable('some tag', [
34 JSXAttributeMock('contentEditable', true),
35 ]),
36 false,
37 'does not identify HTML5 content editable elements with true as the value',
38 );
39
40 st.equal(
41 isContentEditable('some tag', [
42 JSXAttributeMock('contentEditable', 'false'),
43 ]),
44 false,
45 'does not identify HTML5 content editable elements with "false" as the value',
46 );
47
48 st.end();
49 });
50
51 t.end();
52});
Note: See TracBrowser for help on using the repository browser.