File tree Expand file tree Collapse file tree 2 files changed +18
-3
lines changed
Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ const docsUrls = {
1414 dhcp : "https://maas.io/docs/about-dhcp-in-maas" ,
1515 ipmi : "https://maas.io/docs/reference-power-drivers#p-17434-ipmi" ,
1616 ipRanges :
17- "https://maas.io/docs/how-to-customise-dhcp #p-9038-edit-delete-or-extend-ip-range " ,
17+ "https://maas.io/docs/how-to-customise-maas-networks #p-9070-create-ips-and-ranges " ,
1818 kvmIntroduction : "https://maas.io/docs/how-to-use-lxd-vms" ,
1919 networkDiscovery :
2020 "https://maas.io/docs/how-to-customise-maas-networks#p-9070-manage-network-discovery" ,
Original file line number Diff line number Diff line change @@ -3,6 +3,17 @@ import docsUrls from "../src/app/base/docsUrls";
33
44const urls = Object . values ( docsUrls ) ;
55
6+ const redirectErrorMessage = ( url : string , location : string | null ) => `
7+ URL NEEDS TO BE UPDATED
8+ -----------------------------
9+ FROM:
10+ ${ url }
11+
12+ TO:
13+ https://maas.io${ location }
14+
15+ ` ;
16+
617test . describe ( "loads the page" , ( ) => {
718 urls . forEach ( ( url ) => {
819 test ( `${ url } ` , async ( ) => {
@@ -16,9 +27,13 @@ test.describe("loads the page", () => {
1627test . describe ( "is a direct link" , ( ) => {
1728 urls . forEach ( ( url ) => {
1829 test ( `${ url } ` , async ( ) => {
30+ // prevent auto redirect so we can get the HTTP 302 if present
1931 const docsPage = fetch ( url , { redirect : "manual" } ) ;
20- const resCode = await docsPage . then ( ( res ) => res . status ) ;
21- expect ( resCode ) . toBe ( 200 ) ;
32+ const { status, headers } = await docsPage . then ( ( res ) => res ) ;
33+
34+ expect ( status , redirectErrorMessage ( url , headers . get ( "location" ) ) ) . toBe (
35+ 200
36+ ) ;
2237 } ) ;
2338 } ) ;
2439} ) ;
You can’t perform that action at this time.
0 commit comments