@@ -13,7 +13,7 @@ import {YAML_SECTION_KEYS} from '../../src/lib/yaml/schema.js'
1313const ALL_HANDLED_TYPES : HandledResourceType [ ] = [
1414 'tag' , 'environment' , 'secret' , 'alertChannel' ,
1515 'notificationPolicy' , 'webhook' , 'resourceGroup' ,
16- 'monitor' , 'dependency' ,
16+ 'monitor' , 'dependency' , 'statusPage' ,
1717]
1818
1919describe ( 'handler registry' , ( ) => {
@@ -31,9 +31,9 @@ describe('handler registry', () => {
3131 }
3232 } )
3333
34- it ( 'allHandlers returns all 9 handlers' , ( ) => {
34+ it ( 'allHandlers returns all 10 handlers' , ( ) => {
3535 const handlers = allHandlers ( )
36- expect ( handlers ) . toHaveLength ( 9 )
36+ expect ( handlers ) . toHaveLength ( 10 )
3737 const types = new Set ( handlers . map ( ( h ) => h . resourceType ) )
3838 for ( const type of ALL_HANDLED_TYPES ) {
3939 expect ( types . has ( type ) , `allHandlers() missing ${ type } ` ) . toBe ( true )
@@ -67,6 +67,7 @@ describe('handler metadata', () => {
6767 [ 'resourceGroup' , 'resourceGroups' , 'resourceGroups' , '/api/v1/resource-groups' ] ,
6868 [ 'monitor' , 'monitors' , 'monitors' , '/api/v1/monitors' ] ,
6969 [ 'dependency' , 'dependencies' , 'dependencies' , '/api/v1/service-subscriptions' ] ,
70+ [ 'statusPage' , 'statusPages' , 'statusPages' , '/api/v1/status-pages' ] ,
7071 ] as const ) ( '%s → refType=%s, configKey=%s, listPath=%s' , ( type , refType , configKey , listPath ) => {
7172 const h = getHandler ( type )
7273 expect ( h . refType ) . toBe ( refType )
@@ -85,6 +86,7 @@ describe('handler getRefKey', () => {
8586 it ( 'resourceGroup uses name' , ( ) => expect ( getHandler ( 'resourceGroup' ) . getRefKey ( { name : 'API' } ) ) . toBe ( 'API' ) )
8687 it ( 'monitor uses name' , ( ) => expect ( getHandler ( 'monitor' ) . getRefKey ( { name : 'M' } ) ) . toBe ( 'M' ) )
8788 it ( 'dependency uses service slug' , ( ) => expect ( getHandler ( 'dependency' ) . getRefKey ( { service : 'gh' } ) ) . toBe ( 'gh' ) )
89+ it ( 'statusPage uses slug' , ( ) => expect ( getHandler ( 'statusPage' ) . getRefKey ( { slug : 'my-page' , name : 'My Page' } ) ) . toBe ( 'my-page' ) )
8890} )
8991
9092describe ( 'handler getApiRefKey + getApiId' , ( ) => {
@@ -125,6 +127,7 @@ describe('handler deletePath', () => {
125127 [ 'resourceGroup' , '/api/v1/resource-groups/id-1' ] ,
126128 [ 'monitor' , '/api/v1/monitors/id-1' ] ,
127129 [ 'dependency' , '/api/v1/service-subscriptions/id-1' ] ,
130+ [ 'statusPage' , '/api/v1/status-pages/id-1' ] ,
128131 ] as const ) ( '%s → %s' , ( type , expectedPath ) => {
129132 expect ( getHandler ( type ) . deletePath ( 'id-1' , 'ref-1' ) ) . toBe ( expectedPath )
130133 } )
0 commit comments