|
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:
611 bytes
|
| Line | |
|---|
| 1 | import test from 'tape';
|
|---|
| 2 |
|
|---|
| 3 | import getExplicitRole from '../../../src/util/getExplicitRole';
|
|---|
| 4 | import JSXAttributeMock from '../../../__mocks__/JSXAttributeMock';
|
|---|
| 5 |
|
|---|
| 6 | test('getExplicitRole', (t) => {
|
|---|
| 7 | t.equal(
|
|---|
| 8 | getExplicitRole(
|
|---|
| 9 | 'div',
|
|---|
| 10 | [JSXAttributeMock('role', 'button')],
|
|---|
| 11 | ),
|
|---|
| 12 | 'button',
|
|---|
| 13 | 'valid role returns the role',
|
|---|
| 14 | );
|
|---|
| 15 |
|
|---|
| 16 | t.equal(
|
|---|
| 17 | getExplicitRole(
|
|---|
| 18 | 'div',
|
|---|
| 19 | [JSXAttributeMock('role', 'beeswax')],
|
|---|
| 20 | ),
|
|---|
| 21 | null,
|
|---|
| 22 | 'invalid role returns null',
|
|---|
| 23 | );
|
|---|
| 24 |
|
|---|
| 25 | t.equal(
|
|---|
| 26 | getExplicitRole(
|
|---|
| 27 | 'div',
|
|---|
| 28 | [],
|
|---|
| 29 | ),
|
|---|
| 30 | null,
|
|---|
| 31 | 'no role returns null',
|
|---|
| 32 | );
|
|---|
| 33 |
|
|---|
| 34 | t.end();
|
|---|
| 35 | });
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.