Permalink
Cannot retrieve contributors at this time
21 lines (20 sloc)
926 Bytes
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/implicitRoles/menuitem-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 JSXAttributeMock from '../../../../__mocks__/JSXAttributeMock'; | |
import getImplicitRoleForMenuitem from '../../../../src/util/implicitRoles/menuitem'; | |
describe('isAbstractRole', () => { | |
it('works for menu items', () => { | |
expect(getImplicitRoleForMenuitem([JSXAttributeMock('type', 'command')])).toBe('menuitem'); | |
}); | |
it('works for menu item checkboxes', () => { | |
expect(getImplicitRoleForMenuitem([JSXAttributeMock('type', 'checkbox')])).toBe('menuitemcheckbox'); | |
}); | |
it('works for menu item radios', () => { | |
expect(getImplicitRoleForMenuitem([JSXAttributeMock('type', 'radio')])).toBe('menuitemradio'); | |
}); | |
it('works for non-toolbars', () => { | |
expect(getImplicitRoleForMenuitem([JSXAttributeMock('type', '')])).toBe(''); | |
}); | |
it('works for the true case', () => { | |
expect(getImplicitRoleForMenuitem([JSXAttributeMock('type', true)])).toBe(''); | |
}); | |
}); |