@@ -13,6 +13,8 @@ import {
1313 SimulatedServerBanSynchronisationCapability ,
1414} from "matrix-protection-suite" ;
1515
16+ const serverBanCapabilityName = "serverConsequences" ;
17+
1618const serverBanSynchronisationCapabilityRenameSemanticType = SemanticType <
1719 typeof serverBanSynchronisationCapabilityRename
1820> ( "serverBanSynchronisationCapabilityRename" ) . Law ( {
@@ -25,20 +27,17 @@ const serverBanSynchronisationCapabilityRenameSemanticType = SemanticType<
2527 "Should be able to make the subject"
2628 ) ;
2729 const input = {
28- serverConsequences : {
30+ [ serverBanCapabilityName ] : {
2931 capability_provider_name : "SimulatedServerConsequences" ,
3032 } ,
3133 } as unknown as CapabilityProviderConfig ;
3234 const toVersion = 1 ;
3335 const output = ( await migration ( input , toVersion ) ) . expect (
3436 "Migration should succeed for SimulatedServerConsequences"
3537 ) ;
36- expect (
37- output . ServerBanSynchronisationCapability ?. capability_provider_name
38- ) . toBe ( SimulatedServerBanSynchronisationCapability . name ) ;
39- expect (
40- ( output as Record < string , unknown > ) . ServerConsequences
41- ) . toBeUndefined ( ) ;
38+ expect ( output [ serverBanCapabilityName ] ?. capability_provider_name ) . toBe (
39+ SimulatedServerBanSynchronisationCapability . name
40+ ) ;
4241 } ,
4342 } ,
4443 updateServerACLConsequences : {
@@ -50,7 +49,7 @@ const serverBanSynchronisationCapabilityRenameSemanticType = SemanticType<
5049 "Should be able to make the subject"
5150 ) ;
5251 const input = {
53- serverConsequences : {
52+ [ serverBanCapabilityName ] : {
5453 capability_provider_name : "ServerACLConsequences" ,
5554 } ,
5655 } as unknown as CapabilityProviderConfig ;
@@ -60,12 +59,9 @@ const serverBanSynchronisationCapabilityRenameSemanticType = SemanticType<
6059 ) ;
6160
6261 expect ( output [ DRAUPNIR_SCHEMA_VERSION_KEY ] ) . toBe ( toVersion ) ;
63- expect (
64- output . ServerBanSynchronisationCapability ?. capability_provider_name
65- ) . toBe ( ServerACLSynchronisationCapability . name ) ;
66- expect (
67- ( output as Record < string , unknown > ) . ServerConsequences
68- ) . toBeUndefined ( ) ;
62+ expect ( output [ serverBanCapabilityName ] ?. capability_provider_name ) . toBe (
63+ ServerACLSynchronisationCapability . name
64+ ) ;
6965 } ,
7066 } ,
7167 maintainOtherConfigs : {
@@ -91,7 +87,7 @@ const serverBanSynchronisationCapabilityRenameSemanticType = SemanticType<
9187 "SomeOtherProvider"
9288 ) ;
9389 expect (
94- ( output as Record < string , unknown > ) . ServerBanSynchronisationCapability
90+ ( output as Record < string , unknown > ) [ serverBanCapabilityName ]
9591 ) . toBeUndefined ( ) ;
9692 } ,
9793 } ,
@@ -104,7 +100,7 @@ const serverBanSynchronisationCapabilityRenameSemanticType = SemanticType<
104100 "Should be able to make the subject"
105101 ) ;
106102 const input = {
107- serverConsequences : {
103+ [ serverBanCapabilityName ] : {
108104 capability_provider_name : "CustomServerConsequences" ,
109105 } ,
110106 } as unknown as CapabilityProviderConfig ;
0 commit comments