Permalink
Cannot retrieve contributors at this time
51 lines (46 sloc)
1.7 KB
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
codeql-action/node_modules/eslint-plugin-jsx-a11y/__tests__/src/util/isContentEditable-test.js
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import expect from 'expect'; | |
import isContentEditable from '../../../src/util/isContentEditable'; | |
import JSXAttributeMock from '../../../__mocks__/JSXAttributeMock'; | |
describe('isContentEditable', () => { | |
describe('HTML5', () => { | |
describe('content editable', () => { | |
it('should identify HTML5 contentEditable elements', () => { | |
const attributes = [ | |
JSXAttributeMock('contentEditable', 'true'), | |
]; | |
expect(isContentEditable('some tag', attributes)) | |
.toBe(true); | |
}); | |
}); | |
describe('not content editable', () => { | |
it('should not identify HTML5 content editable elements with null as the value', () => { | |
const attributes = [ | |
JSXAttributeMock('contentEditable', null), | |
]; | |
expect(isContentEditable('some tag', attributes)) | |
.toBe(false); | |
}); | |
it('should not identify HTML5 content editable elements with undefined as the value', () => { | |
const attributes = [ | |
JSXAttributeMock('contentEditable', undefined), | |
]; | |
expect(isContentEditable('some tag', attributes)) | |
.toBe(false); | |
}); | |
it('should not identify HTML5 content editable elements with true as the value', () => { | |
const attributes = [ | |
JSXAttributeMock('contentEditable', true), | |
]; | |
expect(isContentEditable('some tag', attributes)) | |
.toBe(false); | |
}); | |
it('should not identify HTML5 content editable elements with "false" as the value', () => { | |
const attributes = [ | |
JSXAttributeMock('contentEditable', 'false'), | |
]; | |
expect(isContentEditable('some tag', attributes)) | |
.toBe(false); | |
}); | |
}); | |
}); | |
}); |