Skip to content
Permalink
9bfb9ba527
Switch branches/tags

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?
Go to file
 
 
Cannot retrieve contributors at this time
21 lines (20 sloc) 926 Bytes
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('');
});
});