@@ -7,7 +7,7 @@ import { AmfSerializer } from "../../index.js";
7
7
8
8
describe ( "AmfSerializer" , ( ) => {
9
9
describe ( "Annotations" , ( ) => {
10
- [ true , ] . forEach ( ( compact ) => {
10
+ [ true , false ] . forEach ( ( compact ) => {
11
11
describe ( compact ? "Compact model" : "Full model" , ( ) => {
12
12
let api ;
13
13
/** @type AmfSerializer */
@@ -26,8 +26,9 @@ describe("AmfSerializer", () => {
26
26
assert . typeOf ( customDomainProperties , 'array' , 'has the customDomainProperties' ) ;
27
27
assert . lengthOf ( customDomainProperties , 1 , 'has a single annotation' ) ;
28
28
const [ annotation ] = customDomainProperties ;
29
- assert . equal ( annotation . extensionName , 'clearanceLevel' , 'has the extensionName' ) ;
30
- const { properties } = /** @type ApiObjectNode */ ( /** @type unknown */ ( annotation ) ) ;
29
+ assert . equal ( annotation . name , 'clearanceLevel' , 'has the extensionName' ) ;
30
+ assert . typeOf ( annotation . extension , 'object' , 'has the extension' ) ;
31
+ const { properties } = /** @type ApiObjectNode */ ( annotation . extension ) ;
31
32
assert . typeOf ( properties , 'object' , 'has properties' ) ;
32
33
const { level, signature } = properties ;
33
34
assert . typeOf ( level , 'object' , 'has the level property' ) ;
@@ -42,8 +43,10 @@ describe("AmfSerializer", () => {
42
43
assert . typeOf ( customDomainProperties , 'array' , 'has the customDomainProperties' ) ;
43
44
assert . lengthOf ( customDomainProperties , 1 , 'has a single annotation' ) ;
44
45
const [ annotation ] = customDomainProperties ;
45
- assert . equal ( annotation . extensionName , 'deprecated' , 'has the extensionName' ) ;
46
- const { value, dataType, } = /** @type ApiScalarNode */ ( /** @type unknown */ ( annotation ) ) ;
46
+ assert . equal ( annotation . name , 'deprecated' , 'has the extensionName' ) ;
47
+ assert . typeOf ( annotation . extension , 'object' , 'has the extension' ) ;
48
+
49
+ const { value, dataType, } = /** @type ApiScalarNode */ ( annotation . extension ) ;
47
50
assert . equal ( dataType , 'http://www.w3.org/2001/XMLSchema#string' , 'has the dataType' ) ;
48
51
assert . equal ( value , 'This operation is deprecated and will be removed.' , 'has the value' ) ;
49
52
} ) ;
0 commit comments