@@ -5,86 +5,6 @@ import Crumb from "./crumb.component";
55import Logger from "../../../__internal__/utils/logger" ;
66import Breadcrumbs from "../breadcrumbs.component" ;
77
8- test ( "logs deprecation warning when using hasFocus prop" , ( ) => {
9- const loggerSpy = jest
10- . spyOn ( Logger , "deprecate" )
11- . mockImplementation ( ( ) => { } ) ;
12-
13- render (
14- < Breadcrumbs >
15- < Crumb href = "#" hasFocus >
16- Link text
17- </ Crumb >
18- </ Breadcrumbs > ,
19- ) ;
20-
21- expect ( loggerSpy ) . toHaveBeenCalledWith (
22- "The 'hasFocus' prop in Crumb is deprecated and will soon be removed." ,
23- ) ;
24-
25- loggerSpy . mockRestore ( ) ;
26- } ) ;
27-
28- test ( "logs deprecation warning when using underline prop" , ( ) => {
29- const loggerSpy = jest
30- . spyOn ( Logger , "deprecate" )
31- . mockImplementation ( ( ) => { } ) ;
32-
33- render (
34- < Breadcrumbs >
35- < Crumb href = "#" underline = "always" >
36- Link text
37- </ Crumb >
38- </ Breadcrumbs > ,
39- ) ;
40-
41- expect ( loggerSpy ) . toHaveBeenCalledWith (
42- "The 'underline' prop in Crumb is deprecated and will soon be removed." ,
43- ) ;
44-
45- loggerSpy . mockRestore ( ) ;
46- } ) ;
47-
48- test ( "logs deprecation warning when using linkSize prop" , ( ) => {
49- const loggerSpy = jest
50- . spyOn ( Logger , "deprecate" )
51- . mockImplementation ( ( ) => { } ) ;
52-
53- render (
54- < Breadcrumbs >
55- < Crumb href = "#" linkSize = "large" >
56- Link text
57- </ Crumb >
58- </ Breadcrumbs > ,
59- ) ;
60-
61- expect ( loggerSpy ) . toHaveBeenCalledWith (
62- "The 'linkSize' prop in Crumb is deprecated and will soon be removed." ,
63- ) ;
64-
65- loggerSpy . mockRestore ( ) ;
66- } ) ;
67-
68- test ( "logs deprecation warning when using bold prop" , ( ) => {
69- const loggerSpy = jest
70- . spyOn ( Logger , "deprecate" )
71- . mockImplementation ( ( ) => { } ) ;
72-
73- render (
74- < Breadcrumbs >
75- < Crumb href = "#" bold >
76- Link text
77- </ Crumb >
78- </ Breadcrumbs > ,
79- ) ;
80-
81- expect ( loggerSpy ) . toHaveBeenCalledWith (
82- "The 'bold' prop in Crumb is deprecated and will soon be removed." ,
83- ) ;
84-
85- loggerSpy . mockRestore ( ) ;
86- } ) ;
87-
888test ( "logs warning when not used within Breadcrumbs" , ( ) => {
899 const loggerSpy = jest . spyOn ( Logger , "error" ) . mockImplementation ( ( ) => { } ) ;
9010
@@ -99,7 +19,7 @@ test("logs warning when not used within Breadcrumbs", () => {
9919 loggerSpy . mockRestore ( ) ;
10020} ) ;
10121
102- test ( "passes href to the anchor element when isCurrent is false" , ( ) => {
22+ test ( "passes ` href` to the anchor element when ` isCurrent` is false" , ( ) => {
10323 render (
10424 < Breadcrumbs >
10525 < Crumb href = "foo" > Link text</ Crumb >
@@ -111,7 +31,7 @@ test("passes href to the anchor element when isCurrent is false", () => {
11131 expect ( link ) . toHaveAttribute ( "href" , "foo" ) ;
11232} ) ;
11333
114- test ( "does not pass href to the anchor element when isCurrent is true" , ( ) => {
34+ test ( "does not pass ` href` to the anchor element when ` isCurrent` is true" , ( ) => {
11535 render (
11636 < Breadcrumbs >
11737 < Crumb href = "foo" data-role = "crumb" isCurrent >
@@ -125,7 +45,7 @@ test("does not pass href to the anchor element when isCurrent is true", () => {
12545 expect ( anchor ) . not . toHaveAttribute ( "href" , "foo" ) ;
12646} ) ;
12747
128- test ( "calls onClick callback when the crumb link is clicked" , async ( ) => {
48+ test ( "calls ` onClick` callback when the crumb link is clicked" , async ( ) => {
12949 const onClick = jest . fn ( ) ;
13050 const user = userEvent . setup ( ) ;
13151 render (
@@ -142,7 +62,7 @@ test("calls onClick callback when the crumb link is clicked", async () => {
14262 expect ( onClick ) . toHaveBeenCalledTimes ( 1 ) ;
14363} ) ;
14464
145- test ( "does not call onClick callback when isCurrent is true" , async ( ) => {
65+ test ( "does not call ` onClick` callback when ` isCurrent` is true" , async ( ) => {
14666 const onClick = jest . fn ( ) ;
14767 const user = userEvent . setup ( ) ;
14868 render (
@@ -159,7 +79,7 @@ test("does not call onClick callback when isCurrent is true", async () => {
15979 expect ( onClick ) . toHaveBeenCalledTimes ( 0 ) ;
16080} ) ;
16181
162- test ( "applies aria-current attribute when isCurrent is true" , ( ) => {
82+ test ( "applies ` aria-current` attribute when ` isCurrent` is true" , ( ) => {
16383 render (
16484 < Breadcrumbs >
16585 < Crumb href = "#" isCurrent >
0 commit comments