@@ -201,40 +201,55 @@ describe('Builtin resources, STDIO', () => {
201201 expect ( templateNames ) . toContain ( 'patternfly://schemas/{name}{?version,category}' ) ;
202202 } ) ;
203203
204- it ( 'should read the patternfly-context resource' , async ( ) => {
204+ it . each ( [
205+ {
206+ description : 'patternfly-components-meta' ,
207+ uri : 'patternfly://components/meta' ,
208+ expected : 'PatternFly Components Index Metadata'
209+ } ,
210+ {
211+ description : 'patternfly-docs-meta' ,
212+ uri : 'patternfly://docs/meta' ,
213+ expected : 'PatternFly Documentation Index Metadata'
214+ } ,
215+ {
216+ description : 'patternfly-schemas-meta' ,
217+ uri : 'patternfly://schemas/meta' ,
218+ expected : 'PatternFly Component Schemas Index Metadata'
219+ }
220+ ] ) ( 'should read meta resources, $description' , async ( { uri, expected } ) => {
205221 const response = await CLIENT . send ( {
206222 method : 'resources/read' ,
207- params : { uri : 'patternfly://context' }
223+ params : { uri }
208224 } ) ;
209225 const content = response ?. result . contents [ 0 ] ;
210226
211- expect ( content . text ) . toContain ( 'PatternFly is an open-source design system' ) ;
212- expect ( content . mimeType ) . toBe ( 'text/markdown' ) ;
227+ expect ( content . uri ) . toBe ( uri ) ;
228+ expect ( content . text ) . toContain ( expected ) ;
229+ expect ( content ) . toMatchSnapshot ( ) ;
213230 } ) ;
214231
215- it ( 'should read the patternfly-docs-index with query params' , async ( ) => {
216- const uri = 'patternfly://docs/index?version=v6&category=accessibility§ion=components' ;
232+ it ( 'should read the patternfly-context resource' , async ( ) => {
217233 const response = await CLIENT . send ( {
218234 method : 'resources/read' ,
219- params : { uri }
235+ params : { uri : 'patternfly://context' }
220236 } ) ;
221237 const content = response ?. result . contents [ 0 ] ;
222238
223- expect ( content . uri ) . toBe ( uri ) ;
224- expect ( content . text ) . toContain ( 'PatternFly Documentation Index ') ;
239+ expect ( content . text ) . toContain ( 'PatternFly is an open-source design system' ) ;
240+ expect ( content . mimeType ) . toBe ( 'text/markdown ') ;
225241 } ) ;
226242
227- it ( 'should read the patternfly-docs-meta ' , async ( ) => {
228- const uri = 'patternfly://docs/meta ' ;
243+ it ( 'should read the patternfly-docs-index with query params ' , async ( ) => {
244+ const uri = 'patternfly://docs/index?version=v6&category=accessibility§ion=components ' ;
229245 const response = await CLIENT . send ( {
230246 method : 'resources/read' ,
231247 params : { uri }
232248 } ) ;
233249 const content = response ?. result . contents [ 0 ] ;
234250
235251 expect ( content . uri ) . toBe ( uri ) ;
236- expect ( content . text ) . toContain ( 'PatternFly Documentation Index Metadata' ) ;
237- expect ( content ) . toMatchSnapshot ( 'meta output' ) ;
252+ expect ( content . text ) . toContain ( 'PatternFly Documentation Index' ) ;
238253 } ) ;
239254
240255 it ( 'should read a doc through a template' , async ( ) => {
@@ -260,18 +275,6 @@ describe('Builtin resources, STDIO', () => {
260275 expect ( content . uri ) . toBe ( uri ) ;
261276 expect ( content . text ) . toContain ( 'PatternFly Component JSON Schemas Index' ) ;
262277 } ) ;
263-
264- it ( 'should read the patternfly-schemas-meta' , async ( ) => {
265- const uri = 'patternfly://schemas/meta' ;
266- const response = await CLIENT . send ( {
267- method : 'resources/read' ,
268- params : { uri }
269- } ) ;
270- const content = response ?. result . contents [ 0 ] ;
271-
272- expect ( content . uri ) . toBe ( uri ) ;
273- expect ( content . text ) . toContain ( 'PatternFly Component Schemas Index Metadata' ) ;
274- } ) ;
275278} ) ;
276279
277280describe ( 'Logging' , ( ) => {
0 commit comments