11import "@testing-library/jest-dom" ;
22import { screen } from "@testing-library/react" ;
3- import { createTheme , Theme } from "@mui/material/styles" ;
3+ import { createTheme , Theme } from "@mui/material/styles" ;
44
55import { renderWithProviders } from "../../__test-utils__/helpers" ;
6- import { BaseThemeOptions } from "../../themes/BaseTheme" ;
6+ import { BaseThemeOptions } from "../../themes/BaseTheme" ;
77
88import { Logo } from "./Logo" ;
99
1010describe ( "Logo" , ( ) => {
11-
1211 const src = "a/test/src" ;
1312 const TestTheme : Theme = createTheme ( {
1413 ...BaseThemeOptions ,
@@ -19,41 +18,40 @@ describe("Logo", () => {
1918 } ,
2019 short : {
2120 src : src + "/short" ,
22- alt : "alt"
21+ alt : "alt" ,
2322 } ,
2423 } ,
2524 } ) ;
26-
27- function render ( logo :any ) {
28- renderWithProviders ( logo , { theme :TestTheme } ) ;
25+
26+ function render ( logo : React . ReactNode ) {
27+ renderWithProviders ( logo , { theme : TestTheme } ) ;
2928 }
30-
29+
3130 it ( "should render without errors" , ( ) => {
32- render ( < Logo /> )
31+ render ( < Logo /> ) ;
3332 } ) ;
3433
3534 it ( "should have am img" , ( ) => {
36- render ( < Logo /> ) ;
35+ render ( < Logo /> ) ;
3736 const img = screen . getByRole ( "img" ) ;
38-
37+
3938 expect ( img ) . toBeInTheDocument ( ) ;
40- expect ( img ) . toHaveAttribute ( "src" , src )
39+ expect ( img ) . toHaveAttribute ( "src" , src ) ;
4140 } ) ;
42-
41+
4342 it ( "should have an img when short" , ( ) => {
4443 render ( < Logo short = { true } /> ) ;
45-
44+
4645 const img = screen . getByRole ( "img" ) ;
4746 expect ( img ) . toBeInTheDocument ( ) ;
48- expect ( img ) . toHaveAttribute ( "src" , src + "/short" )
47+ expect ( img ) . toHaveAttribute ( "src" , src + "/short" ) ;
4948 } ) ;
50-
49+
5150 it ( "should have a margin" , ( ) => {
52- render ( < Logo style = { { margin :"10px" } } /> ) ;
53-
51+ render ( < Logo style = { { margin : "10px" } } /> ) ;
52+
5453 const img = screen . getByRole ( "img" ) ;
5554 expect ( img ) . toBeInTheDocument ( ) ;
56- expect ( img ) . toHaveAttribute ( "style" , "margin: 10px;" )
55+ expect ( img ) . toHaveAttribute ( "style" , "margin: 10px;" ) ;
5756 } ) ;
58-
5957} ) ;
0 commit comments