@@ -8,31 +8,25 @@ import {Text} from '../../Text';
88describe ( '<Breadcrumbs />' ,  ( )  =>  { 
99  describe ( 'url' ,  ( )  =>  { 
1010    it ( 'uses <a> tags when passed a LinkAction' ,  ( )  =>  { 
11-       const  linkBreadcrumbs : LinkAction [ ]  =  [ 
12-         { 
13-           content : 'Products' , 
14-           url : 'https://www.shopify.com' , 
15-         } , 
16-       ] ; 
17- 
11+       const  linkBreadcrumb : LinkAction  =  { 
12+         content : 'Products' , 
13+         url : 'https://www.shopify.com' , 
14+       } ; 
1815      const  breadcrumbs  =  mountWithApp ( 
19-         < Breadcrumbs  breadcrumbs = { linkBreadcrumbs }  /> , 
16+         < Breadcrumbs  breadcrumb = { linkBreadcrumb }  /> , 
2017      ) ; 
2118
2219      expect ( breadcrumbs ) . toContainReactComponentTimes ( 'a' ,  1 ) ; 
2320    } ) ; 
2421
2522    it ( 'passes the accessibilityLabel through to <a> tag' ,  ( )  =>  { 
26-       const  linkBreadcrumbs : LinkAction [ ]  =  [ 
27-         { 
28-           content : 'Products' , 
29-           url : 'https://shopify.com' , 
30-           accessibilityLabel : 'Go to Products' , 
31-         } , 
32-       ] ; 
33- 
23+       const  linkBreadcrumb : LinkAction  =  { 
24+         content : 'Products' , 
25+         url : 'https://shopify.com' , 
26+         accessibilityLabel : 'Go to Products' , 
27+       } ; 
3428      const  breadcrumbs  =  mountWithApp ( 
35-         < Breadcrumbs  breadcrumbs = { linkBreadcrumbs }  /> , 
29+         < Breadcrumbs  breadcrumb = { linkBreadcrumb }  /> , 
3630      ) ; 
3731
3832      expect ( breadcrumbs ) . toContainReactComponent ( 'a' ,  { 
@@ -43,31 +37,25 @@ describe('<Breadcrumbs />', () => {
4337
4438  describe ( 'onAction()' ,  ( )  =>  { 
4539    it ( 'uses <button> tags when passed a CallbackAction' ,  ( )  =>  { 
46-       const  callbackBreadcrumbs : CallbackAction [ ]  =  [ 
47-         { 
48-           content : 'Products' , 
49-           onAction : noop , 
50-         } , 
51-       ] ; 
52- 
40+       const  callbackBreadcrumb : CallbackAction  =  { 
41+         content : 'Products' , 
42+         onAction : noop , 
43+       } ; 
5344      const  breadcrumbs  =  mountWithApp ( 
54-         < Breadcrumbs  breadcrumbs = { callbackBreadcrumbs }  /> , 
45+         < Breadcrumbs  breadcrumb = { callbackBreadcrumb }  /> , 
5546      ) ; 
5647
5748      expect ( breadcrumbs ) . toContainReactComponentTimes ( 'button' ,  1 ) ; 
5849    } ) ; 
5950
6051    it ( 'passes accessibilityLabel through to <button> tag' ,  ( )  =>  { 
61-       const  callbackBreadcrumbs : CallbackAction [ ]  =  [ 
62-         { 
63-           content : 'Products' , 
64-           onAction : noop , 
65-           accessibilityLabel : 'Go to Products' , 
66-         } , 
67-       ] ; 
68- 
52+       const  callbackBreadcrumb : CallbackAction  =  { 
53+         content : 'Products' , 
54+         onAction : noop , 
55+         accessibilityLabel : 'Go to Products' , 
56+       } ; 
6957      const  breadcrumbs  =  mountWithApp ( 
70-         < Breadcrumbs  breadcrumbs = { callbackBreadcrumbs }  /> , 
58+         < Breadcrumbs  breadcrumb = { callbackBreadcrumb }  /> , 
7159      ) ; 
7260
7361      expect ( breadcrumbs ) . toContainReactComponent ( 'button' ,  { 
@@ -77,43 +65,32 @@ describe('<Breadcrumbs />', () => {
7765
7866    it ( 'triggers the callback function when clicked' ,  ( )  =>  { 
7967      const  spy  =  jest . fn ( ) ; 
80-       const  callbackBreadcrumbs : CallbackAction [ ]  =  [ 
81-         { 
82-           content : 'Products' , 
83-           onAction : spy , 
84-         } , 
85-       ] ; 
86- 
68+       const  callbackBreadcrumb : CallbackAction  =  { 
69+         content : 'Products' , 
70+         onAction : spy , 
71+       } ; 
8772      const  breadcrumbs  =  mountWithApp ( 
88-         < Breadcrumbs  breadcrumbs = { callbackBreadcrumbs }  /> , 
73+         < Breadcrumbs  breadcrumb = { callbackBreadcrumb }  /> , 
8974      ) ; 
9075
9176      breadcrumbs . find ( 'button' ) ! . trigger ( 'onClick' ) ; 
9277      expect ( spy ) . toHaveBeenCalled ( ) ; 
9378    } ) ; 
9479  } ) ; 
9580
96-   const  linkBreadcrumbs : LinkAction [ ]  =  [ 
97-     { 
98-       content : 'Products' , 
99-       url : 'https://www.shopify.com' , 
100-     } , 
101-   ] ; 
81+   const  linkBreadcrumb : LinkAction  =  { 
82+     content : 'Products' , 
83+     url : 'https://www.shopify.com' , 
84+   } ; 
10285
10386  it ( 'renders breadcrumb content as a visually hidden label when the new design language is enabled' ,  ( )  =>  { 
104-     const  wrapper  =  mountWithApp ( < Breadcrumbs  breadcrumbs = { linkBreadcrumbs }  /> ) ; 
87+     const  wrapper  =  mountWithApp ( < Breadcrumbs  breadcrumb = { linkBreadcrumb }  /> ) ; 
10588
10689    expect ( wrapper ) . toContainReactComponent ( Text ,  { 
10790      children : 'Products' , 
10891      visuallyHidden : true , 
10992    } ) ; 
11093  } ) ; 
111- 
112-   it ( 'renders nothing when empty' ,  ( )  =>  { 
113-     const  wrapper  =  mountWithApp ( < Breadcrumbs  breadcrumbs = { [ ] }  /> ) ; 
114- 
115-     expect ( wrapper . html ( ) ) . toBe ( '' ) ; 
116-   } ) ; 
11794} ) ; 
11895
11996function  noop ( )  { } 
0 commit comments