File tree Expand file tree Collapse file tree 3 files changed +26
-3
lines changed
e2e/__tests__/app-impress
impress/src/pages/docs/[id] Expand file tree Collapse file tree 3 files changed +26
-3
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ and this project adheres to
2121- 🐛(i18n) same frontend and backend language using shared cookies #365
2222- 🐛(frontend) add default toolbar buttons #355
2323- 🐛(frontend) throttle error correctly display #378
24+ - 🐛(frontend) (frontend) avoid documents indexing in search engine #372
2425
2526## Removed
2627
Original file line number Diff line number Diff line change @@ -7,6 +7,22 @@ test.describe('Doc Routing', () => {
77 await page . goto ( '/' ) ;
88 } ) ;
99
10+ test ( 'Check the presence of the meta tag noindex' , async ( { page } ) => {
11+ const buttonCreateHomepage = page . getByRole ( 'button' , {
12+ name : 'Create a new document' ,
13+ } ) ;
14+
15+ await expect ( buttonCreateHomepage ) . toBeVisible ( ) ;
16+ await buttonCreateHomepage . click ( ) ;
17+ await expect (
18+ page . getByRole ( 'button' , {
19+ name : 'Share' ,
20+ } ) ,
21+ ) . toBeVisible ( ) ;
22+ const metaDescription = page . locator ( 'meta[name="robots"]' ) ;
23+ await expect ( metaDescription ) . toHaveAttribute ( 'content' , 'noindex' ) ;
24+ } ) ;
25+
1026 test ( 'checks alias docs url with homepage' , async ( { page } ) => {
1127 await expect ( page ) . toHaveURL ( '/' ) ;
1228
Original file line number Diff line number Diff line change 11import { Loader } from '@openfun/cunningham-react' ;
2+ import Head from 'next/head' ;
23import { useRouter as useNavigate } from 'next/navigation' ;
34import { useRouter } from 'next/router' ;
45import { useEffect , useState } from 'react' ;
@@ -21,9 +22,14 @@ export function DocLayout() {
2122 }
2223
2324 return (
24- < MainLayout withoutFooter >
25- < DocPage id = { id } />
26- </ MainLayout >
25+ < >
26+ < Head >
27+ < meta name = "robots" content = "noindex" />
28+ </ Head >
29+ < MainLayout withoutFooter >
30+ < DocPage id = { id } />
31+ </ MainLayout >
32+ </ >
2733 ) ;
2834}
2935
You can’t perform that action at this time.
0 commit comments