Skip to content

Commit 922f3ef

Browse files
committed
Update tests to account for new endpoints and methods
1 parent 90946cf commit 922f3ef

File tree

1 file changed

+22
-5
lines changed

1 file changed

+22
-5
lines changed

tests/unit/lib/route-tree.js

+22-5
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,30 @@ describe( 'route-tree utility', () => {
2020

2121
it( 'includes objects for all default wp/v2 routes', () => {
2222
const routes = Object.keys( tree[ 'wp/v2' ] ).sort();
23-
expect( routes.length ).toBe( 11 );
24-
expect( routes.join( ',' ) )
25-
.toBe( 'categories,comments,media,pages,posts,settings,statuses,tags,taxonomies,types,users' );
23+
expect( routes.length ).toBe( 15 );
24+
expect( routes.sort() ).toEqual( [
25+
'block-renderer',
26+
'blocks',
27+
'categories',
28+
'comments',
29+
'media',
30+
'pages',
31+
'posts',
32+
'search',
33+
'settings',
34+
'statuses',
35+
'tags',
36+
'taxonomies',
37+
'themes',
38+
'types',
39+
'users',
40+
] );
2641
} );
2742

2843
it( 'includes objects for all default oembed/1.0 routes', () => {
2944
const routes = Object.keys( tree[ 'oembed/1.0' ] ).sort();
30-
expect( routes.length ).toBe( 1 );
31-
expect( routes.join( ',' ) ).toBe( 'embed' );
45+
expect( routes.length ).toBe( 2 );
46+
expect( routes.sort().join( ',' ) ).toBe( 'embed,proxy' );
3247
} );
3348

3449
// Inspect the .posts tree as a smoke test for whether parsing the API
@@ -58,10 +73,12 @@ describe( 'route-tree utility', () => {
5873
author_exclude: {},
5974
before: {},
6075
exclude: {},
76+
id: {},
6177
include: {},
6278
offset: {},
6379
order: {},
6480
orderby: {},
81+
parent: {},
6582
password: {},
6683
slug: {},
6784
status: {},

0 commit comments

Comments
 (0)