@@ -8,124 +8,76 @@ describe('getTabIndex', () => {
88 describe ( 'as a number ' , ( ) => {
99 describe ( 'zero' , ( ) => {
1010 it ( 'should return zero' , ( ) => {
11- expect (
12- getTabIndex (
13- JSXAttributeMock ( 'tabIndex' , 0 ) ,
14- ) ,
15- ) . toBe ( 0 ) ;
11+ expect ( getTabIndex ( JSXAttributeMock ( 'tabIndex' , 0 ) ) ) . toBe ( 0 ) ;
1612 } ) ;
1713 } ) ;
1814 describe ( 'positive integer' , ( ) => {
1915 it ( 'should return the integer' , ( ) => {
20- expect (
21- getTabIndex (
22- JSXAttributeMock ( 'tabIndex' , 1 ) ,
23- ) ,
24- ) . toBe ( 1 ) ;
16+ expect ( getTabIndex ( JSXAttributeMock ( 'tabIndex' , 1 ) ) ) . toBe ( 1 ) ;
2517 } ) ;
2618 } ) ;
2719 describe ( 'negative integer' , ( ) => {
2820 it ( 'should return the integer' , ( ) => {
29- expect (
30- getTabIndex (
31- JSXAttributeMock ( 'tabIndex' , - 1 ) ,
32- ) ,
33- ) . toBe ( - 1 ) ;
21+ expect ( getTabIndex ( JSXAttributeMock ( 'tabIndex' , - 1 ) ) ) . toBe ( - 1 ) ;
3422 } ) ;
3523 } ) ;
3624 describe ( 'float' , ( ) => {
3725 it ( 'should return undefined' , ( ) => {
38- expect (
39- getTabIndex (
40- JSXAttributeMock ( 'tabIndex' , 9.1 ) ,
41- ) ,
42- ) . toBeUndefined ( ) ;
26+ expect ( getTabIndex ( JSXAttributeMock ( 'tabIndex' , 9.1 ) ) ) . toBeUndefined ( ) ;
4327 } ) ;
4428 } ) ;
4529 } ) ;
4630 describe ( 'as a string' , ( ) => {
4731 describe ( 'empty' , ( ) => {
4832 it ( 'should return undefined' , ( ) => {
49- expect (
50- getTabIndex (
51- JSXAttributeMock ( 'tabIndex' , '' ) ,
52- ) ,
53- ) . toBeUndefined ( ) ;
33+ expect ( getTabIndex ( JSXAttributeMock ( 'tabIndex' , '' ) ) ) . toBeUndefined ( ) ;
5434 } ) ;
5535 } ) ;
5636 describe ( 'which converts to a number' , ( ) => {
5737 it ( 'should return an integer' , ( ) => {
58- expect (
59- getTabIndex (
60- JSXAttributeMock ( 'tabIndex' , '0' ) ,
61- ) ,
62- ) . toBe ( 0 ) ;
38+ expect ( getTabIndex ( JSXAttributeMock ( 'tabIndex' , '0' ) ) ) . toBe ( 0 ) ;
6339 } ) ;
6440 } ) ;
6541 describe ( 'which is NaN' , ( ) => {
6642 it ( 'should return undefined' , ( ) => {
67- expect (
68- getTabIndex (
69- JSXAttributeMock ( 'tabIndex' , '0a' ) ,
70- ) ,
71- ) . toBeUndefined ( ) ;
43+ expect ( getTabIndex ( JSXAttributeMock ( 'tabIndex' , '0a' ) ) ) . toBeUndefined ( ) ;
7244 } ) ;
7345 } ) ;
7446 } ) ;
7547 describe ( 'as a boolean' , ( ) => {
7648 describe ( 'true' , ( ) => {
7749 it ( 'should return undefined' , ( ) => {
78- expect (
79- getTabIndex (
80- JSXAttributeMock ( 'tabIndex' , true ) ,
81- ) ,
82- ) . toBeUndefined ( ) ;
50+ expect ( getTabIndex ( JSXAttributeMock ( 'tabIndex' , true ) ) ) . toBeUndefined ( ) ;
8351 } ) ;
8452 } ) ;
8553 describe ( 'false' , ( ) => {
8654 it ( 'should return undefined' , ( ) => {
87- expect (
88- getTabIndex (
89- JSXAttributeMock ( 'tabIndex' , false ) ,
90- ) ,
91- ) . toBeUndefined ( ) ;
55+ expect ( getTabIndex ( JSXAttributeMock ( 'tabIndex' , false ) ) ) . toBeUndefined ( ) ;
9256 } ) ;
9357 } ) ;
9458 } ) ;
9559 describe ( 'as an expression' , ( ) => {
9660 describe ( 'function expression' , ( ) => {
9761 it ( 'should return the correct type' , ( ) => {
9862 const attr = function mockFn ( ) { return 0 ; } ;
99- expect (
100- typeof getTabIndex (
101- JSXAttributeMock ( 'tabIndex' , attr ) ,
102- ) ,
103- ) . toEqual ( 'function' ) ;
63+ expect ( typeof getTabIndex ( JSXAttributeMock ( 'tabIndex' , attr ) ) ) . toEqual ( 'function' ) ;
10464 } ) ;
10565 } ) ;
10666 describe ( 'variable expression' , ( ) => {
10767 it ( 'should return the Identifier name' , ( ) => {
10868 const name = 'identName' ;
109- expect (
110- getTabIndex (
111- JSXAttributeMock (
112- 'tabIndex' ,
113- IdentifierMock ( name ) ,
114- true ,
115- ) ,
116- ) ,
117- ) . toEqual ( name ) ;
69+ expect ( getTabIndex ( JSXAttributeMock (
70+ 'tabIndex' ,
71+ IdentifierMock ( name ) ,
72+ true ,
73+ ) ) ) . toEqual ( name ) ;
11874 } ) ;
11975 } ) ;
12076 } ) ;
12177 } ) ;
12278 describe ( 'tabIndex is not defined' , ( ) => {
12379 it ( 'should return undefined' , ( ) => {
124- expect (
125- getTabIndex (
126- JSXAttributeMock ( 'tabIndex' , undefined ) ,
127- ) ,
128- ) . toBeUndefined ( ) ;
80+ expect ( getTabIndex ( JSXAttributeMock ( 'tabIndex' , undefined ) ) ) . toBeUndefined ( ) ;
12981 } ) ;
13082 } ) ;
13183} ) ;
0 commit comments