File tree Expand file tree Collapse file tree 7 files changed +33
-7
lines changed
__tests__/unit/components Expand file tree Collapse file tree 7 files changed +33
-7
lines changed Original file line number Diff line number Diff line change @@ -39,4 +39,30 @@ describe('BreadCrumb', () => {
3939 expect ( lastSegment ) . toBeInTheDocument ( )
4040 expect ( lastSegment ) . not . toHaveAttribute ( 'href' )
4141 } )
42+
43+ test ( 'links have correct href attributes' , ( ) => {
44+ ; ( usePathname as jest . Mock ) . mockReturnValue ( '/dashboard/users/profile' )
45+
46+ render ( < BreadCrumbs /> )
47+
48+ const homeLink = screen . getByText ( 'Home' ) . closest ( 'a' )
49+ const dashboardLink = screen . getByText ( 'Dashboard' ) . closest ( 'a' )
50+ const usersLink = screen . getByText ( 'Users' ) . closest ( 'a' )
51+
52+ expect ( homeLink ) . toHaveAttribute ( 'href' , '/' )
53+ expect ( dashboardLink ) . toHaveAttribute ( 'href' , '/dashboard' )
54+ expect ( usersLink ) . toHaveAttribute ( 'href' , '/dashboard/users' )
55+ } )
56+
57+ test ( 'links have hover styles' , ( ) => {
58+ ; ( usePathname as jest . Mock ) . mockReturnValue ( '/dashboard/users' )
59+
60+ render ( < BreadCrumbs /> )
61+
62+ const homeLink = screen . getByText ( 'Home' ) . closest ( 'a' )
63+ const dashboardLink = screen . getByText ( 'Dashboard' ) . closest ( 'a' )
64+
65+ expect ( homeLink ) . toHaveClass ( 'hover:text-blue-700' , 'hover:underline' )
66+ expect ( dashboardLink ) . toHaveClass ( 'hover:text-blue-700' , 'hover:underline' )
67+ } )
4268} )
Original file line number Diff line number Diff line change @@ -72,7 +72,7 @@ const About = () => {
7272 }
7373
7474 return (
75- < div className = "mt-16 min-h-screen p-8 text-gray-600 dark:bg-[#212529] dark:text-gray-300" >
75+ < div className = "min-h-screen p-8 text-gray-600 dark:bg-[#212529] dark:text-gray-300" >
7676 < div className = "mx-auto max-w-6xl" >
7777 < h1 className = "mb-6 mt-4 text-4xl font-bold" > About</ h1 >
7878 < SecondaryCard icon = { faScroll } title = "History" >
Original file line number Diff line number Diff line change @@ -110,7 +110,7 @@ const SnapshotDetailsPage: React.FC = () => {
110110 }
111111
112112 return (
113- < div className = "mx-auto mt-16 min-h-screen max-w-6xl p-4" >
113+ < div className = "mx-auto min-h-screen max-w-6xl p-4" >
114114 < div className = "mb-8 mt-8 rounded-lg border border-gray-200 bg-white p-6 shadow-sm dark:border-gray-700 dark:bg-gray-800" >
115115 < div className = "flex flex-wrap items-start justify-between gap-4" >
116116 < div >
Original file line number Diff line number Diff line change @@ -62,8 +62,8 @@ const SnapshotsPage: React.FC = () => {
6262 }
6363
6464 return (
65- < div className = "mt-16 min-h-screen p-8 text-gray-600 dark:bg-[#212529] dark:text-gray-300" >
66- < div className = "mt-16 flex min-h-screen w-full flex-col items-center justify-normal p-5 text-text" >
65+ < div className = "min-h-screen p-8 text-gray-600 dark:bg-[#212529] dark:text-gray-300" >
66+ < div className = "flex min-h-screen w-full flex-col items-center justify-normal p-5 text-text" >
6767 < div className = "grid grid-cols-1 gap-6 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4" >
6868 { ! snapshots ?. length ? (
6969 < div className = "col-span-full py-8 text-center" > No Snapshots found</ div >
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ export default function BreadCrumbs() {
1515 if ( pathname === homeRoute ) return null
1616
1717 return (
18- < div className = "absolute bottom-2 left-0 top-1 mt-16 w-full py-2 " >
18+ < div className = "mt-16 w-full pt-4 " >
1919 < div className = "w-full px-8 sm:px-8 md:px-8 lg:px-8" >
2020 < Breadcrumbs
2121 aria-label = "breadcrumb"
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ const DetailsCard = ({
4646 repositories = [ ] ,
4747} : DetailsCardProps ) => {
4848 return (
49- < div className = "mt-16 min-h-screen bg-white p-8 text-gray-600 dark:bg-[#212529] dark:text-gray-300" >
49+ < div className = "min-h-screen bg-white p-8 text-gray-600 dark:bg-[#212529] dark:text-gray-300" >
5050 < div className = "mx-auto max-w-6xl" >
5151 < h1 className = "mb-6 mt-4 text-4xl font-bold" > { title } </ h1 >
5252 < p className = "mb-6 text-xl" > { description } </ p >
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ const SearchPageLayout = ({
4040 }
4141 } , [ isLoaded , isFirstLoad ] )
4242 return (
43- < div className = "mt-16 flex min-h-screen w-full flex-col items-center justify-normal p-5 text-text" >
43+ < div className = "flex min-h-screen w-full flex-col items-center justify-normal p-5 text-text" >
4444 < div className = "flex w-full items-center justify-center" >
4545 < SearchBar
4646 isLoaded = { isFirstLoad }
You can’t perform that action at this time.
0 commit comments