File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -3,16 +3,17 @@ import { getMetadataDescription } from "@/utilities/Metadata";
3
3
import "@testing-library/jest-dom" ;
4
4
import { render , screen } from "@testing-library/react" ;
5
5
6
- describe ( "MetaData" , ( ) => {
7
- const description = "Test description" ;
6
+ const description = "Test description" ;
7
+ const expectedMetaTags = getMetadataDescription ( description ) ;
8
8
9
- it ( "should render metaData" , ( ) => {
9
+ describe ( "MetaData" , ( ) => {
10
+ it ( "should render metaData tags" , ( ) => {
10
11
render ( < MetaData description = { description } /> ) ;
11
- const metadata = screen . queryByTestId ( "meta-id" ) ;
12
- expect ( metadata ) . toBeInTheDocument ( ) ;
12
+ const metaTags = screen . getAllByTestId ( "meta-id" ) ;
13
+ expect ( metaTags ) . toHaveLength ( expectedMetaTags . length ) ;
13
14
} ) ;
14
15
15
- it ( "should render meta tags" , ( ) => {
16
+ it ( "should render the correct content in the meta tags" , ( ) => {
16
17
render ( < MetaData description = { description } /> ) ;
17
18
const mockMetas = getMetadataDescription ( description ) ;
18
19
mockMetas . forEach ( ( meta , index ) => {
You can’t perform that action at this time.
0 commit comments