File tree Expand file tree Collapse file tree 3 files changed +21
-3
lines changed
fixtures/data/learning-tracks Expand file tree Collapse file tree 3 files changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -11,3 +11,4 @@ bar_foo:
11
11
guides :
12
12
- /code-security/getting-started/securing-your-organization
13
13
- /code-security/getting-started/quickstart
14
+ - /rest/actions
Original file line number Diff line number Diff line change 1
- import { getDOMCached as getDOM } from '#src/tests/helpers/e2etest.js'
1
+ import { get , getDOMCached as getDOM } from '#src/tests/helpers/e2etest.js'
2
2
3
3
describe ( 'guides' , ( ) => {
4
4
test ( "page's title should be document title" , async ( ) => {
@@ -94,4 +94,11 @@ describe('learning tracks', () => {
94
94
expect ( $ ( '[data-testid=learning-track-nav]' ) . length ) . toBe ( 0 )
95
95
}
96
96
} )
97
+
98
+ test ( 'REST category learning track article works' , async ( ) => {
99
+ const response = await get ( '/rest/actions?learnProduct=code-security&learn=bar_foo' , {
100
+ followAllRedirects : true ,
101
+ } )
102
+ expect ( response . statusCode ) . toBe ( 200 )
103
+ } )
97
104
} )
Original file line number Diff line number Diff line change 1
1
import { GetServerSideProps } from 'next'
2
2
import { Operation } from 'src/rest/components/types'
3
3
import { RestReferencePage } from 'src/rest/components/RestReferencePage'
4
- import { getMainContext , MainContext , MainContextT } from 'src/frame/components/context/MainContext'
4
+ import {
5
+ addUINamespaces ,
6
+ getMainContext ,
7
+ MainContext ,
8
+ MainContextT ,
9
+ } from 'src/frame/components/context/MainContext'
5
10
import {
6
11
AutomatedPageContext ,
7
12
AutomatedPageContextT ,
@@ -200,10 +205,15 @@ export const getServerSideProps: GetServerSideProps<Props> = async (context) =>
200
205
// created.
201
206
tocLandingContext . tocItems = restCategoryTocItems
202
207
208
+ const mainContext = await getMainContext ( req , res )
209
+ if ( tocLandingContext . currentLearningTrack ?. trackName ) {
210
+ addUINamespaces ( req , mainContext . data . ui , [ 'learning_track_nav' ] )
211
+ }
212
+
203
213
return {
204
214
props : {
205
215
restOperations,
206
- mainContext : await getMainContext ( req , res ) ,
216
+ mainContext,
207
217
automatedPageContext : getAutomatedPageContextFromRequest ( req ) ,
208
218
tocLandingContext,
209
219
} ,
You can’t perform that action at this time.
0 commit comments