@@ -69,6 +69,86 @@ describe('test-descriptions', () => {
6969 ) ;
7070 } ) ;
7171
72+ it ( 'should check description for static method' , ( ) => {
73+ const path = 'api.Interface.create_static' ;
74+ /** @type {CompatStatement } */
75+ const data = {
76+ description : '' ,
77+ support : { } ,
78+ } ;
79+
80+ const errors = processData ( data , 'api' , path ) ;
81+ assert . equal ( errors . length , 1 ) ;
82+ assert . equal (
83+ /** @type {DescriptionError } */ ( errors [ 0 ] ) . ruleName ,
84+ 'static' ,
85+ ) ;
86+ } ) ;
87+
88+ it ( 'should accept static method description' , ( ) => {
89+ const path = 'api.Interface.create_static' ;
90+ /** @type {CompatStatement } */
91+ const data = {
92+ description : '`create()` static method' ,
93+ support : { } ,
94+ } ;
95+
96+ const errors = processData ( data , 'api' , path ) ;
97+ assert . equal ( errors . length , 0 ) ;
98+ } ) ;
99+
100+ it ( 'should accept static property description' , ( ) => {
101+ const path = 'api.Interface.maxActions_static' ;
102+ /** @type {CompatStatement } */
103+ const data = {
104+ description : '`maxActions` static property' ,
105+ support : { } ,
106+ } ;
107+
108+ const errors = processData ( data , 'api' , path ) ;
109+ assert . equal ( errors . length , 0 ) ;
110+ } ) ;
111+
112+ it ( 'should accept static method description with trailing context' , ( ) => {
113+ const path = 'api.console.exception_static' ;
114+ /** @type {CompatStatement } */
115+ const data = {
116+ description : '`exception()` static method (an alias for `error()`)' ,
117+ support : { } ,
118+ } ;
119+
120+ const errors = processData ( data , 'api' , path ) ;
121+ assert . equal ( errors . length , 0 ) ;
122+ } ) ;
123+
124+ it ( 'should reject static description with wrong name' , ( ) => {
125+ const path = 'api.Interface.only_static' ;
126+ /** @type {CompatStatement } */
127+ const data = {
128+ description : '`lowerBound()` static method' ,
129+ support : { } ,
130+ } ;
131+
132+ const errors = processData ( data , 'api' , path ) ;
133+ assert . equal ( errors . length , 1 ) ;
134+ assert . equal (
135+ /** @type {DescriptionError } */ ( errors [ 0 ] ) . ruleName ,
136+ 'static' ,
137+ ) ;
138+ } ) ;
139+
140+ it ( 'should ignore _static_property suffix' , ( ) => {
141+ const path = 'api.Interface.disabledFeatures_static_property' ;
142+ /** @type {CompatStatement } */
143+ const data = {
144+ description : 'Supports `disabledFeatures` static property' ,
145+ support : { } ,
146+ } ;
147+
148+ const errors = processData ( data , 'api' , path ) ;
149+ assert . equal ( errors . length , 0 ) ;
150+ } ) ;
151+
72152 it ( 'should check description for secure context required' , ( ) => {
73153 const path = 'api.Interface.secure_context_required' ;
74154 /** @type {CompatStatement } */
0 commit comments