@@ -11,7 +11,7 @@ const COMPONENTS_RESPONSE_PATH = [
1111] 
1212
1313describe ( 'Openapi3.1 Components PathItems Rules' ,  ( )  =>  { 
14-   test ( 'could be a replace annotation ' ,  async  ( )  =>  { 
14+   test ( 'reports changes to path items in components ' ,  async  ( )  =>  { 
1515    const  before  =  { 
1616      'openapi' : '3.1.0' , 
1717      'paths' : { 
@@ -82,135 +82,4 @@ describe('Openapi3.1 Components PathItems Rules', () => {
8282      } ) , 
8383    ] ) ) 
8484  } ) 
85- 
86-   test ( 'could be a remove annotation' ,  async  ( )  =>  { 
87-     const  before  =  { 
88-       'openapi' : '3.1.0' , 
89-       'paths' : { 
90-         '/path1' : { 
91-           'post' : { 
92-             'responses' : { 
93-               '200' : { } , 
94-             } , 
95-           } , 
96-         } , 
97-       } , 
98-       'components' : { 
99-         'pathItems' : { 
100-           'componentsPathItem' : { 
101-             'post' : { 
102-               'responses' : { 
103-                 '200' : { 
104-                   'description' : 'Pet successfully added' , 
105-                 } , 
106-               } , 
107-             } , 
108-           } , 
109-         } , 
110-       } , 
111-     } 
112- 
113-     const  after  =  { 
114-       'openapi' : '3.1.0' , 
115-       'paths' : { 
116-         '/path1' : { 
117-           'post' : { 
118-             'responses' : { 
119-               '200' : { } , 
120-             } , 
121-           } , 
122-         } , 
123-       } , 
124-       'components' : { 
125-         'pathItems' : { 
126-           'componentsPathItem' : { 
127-             'post' : { 
128-               'responses' : { 
129-                 '200' : { 
130-                 } , 
131-               } , 
132-             } , 
133-           } , 
134-         } , 
135-       } , 
136-     } 
137- 
138-     const  result  =  apiDiff ( before ,  after ) 
139-     expect ( result . diffs ) . toEqual ( diffsMatcher ( [ 
140-       expect . objectContaining ( { 
141-         action : DiffAction . remove , 
142-         beforeValue : 'Pet successfully added' , 
143-         beforeDeclarationPaths : [ [ 
144-           ...COMPONENTS_RESPONSE_PATH , 
145-           'description' , 
146-         ] ] , 
147-         type : ClassifierType . annotation , 
148-       } ) , 
149-     ] ) ) 
150-   } ) 
151-   test ( 'could be a add annotation' ,  async  ( )  =>  { 
152-     const  before  =  { 
153-       'openapi' : '3.1.0' , 
154-       'paths' : { 
155-         '/path1' : { 
156-           'post' : { 
157-             'responses' : { 
158-               '200' : { } , 
159-             } , 
160-           } , 
161-         } , 
162-       } , 
163-       'components' : { 
164-         'pathItems' : { 
165-           'componentsPathItem' : { 
166-             'post' : { 
167-               'responses' : { 
168-                 '200' : { 
169-                 } , 
170-               } , 
171-             } , 
172-           } , 
173-         } , 
174-       } , 
175-     } 
176- 
177-     const  after  =  { 
178-       'openapi' : '3.1.0' , 
179-       'paths' : { 
180-         '/path1' : { 
181-           'post' : { 
182-             'responses' : { 
183-               '200' : { } , 
184-             } , 
185-           } , 
186-         } , 
187-       } , 
188-       'components' : { 
189-         'pathItems' : { 
190-           'componentsPathItem' : { 
191-             'post' : { 
192-               'responses' : { 
193-                 '200' : { 
194-                   'description' : 'Pet successfully added' , 
195-                 } , 
196-               } , 
197-             } , 
198-           } , 
199-         } , 
200-       } , 
201-     } 
202- 
203-     const  result  =  apiDiff ( before ,  after ) 
204-     expect ( result . diffs ) . toEqual ( diffsMatcher ( [ 
205-       expect . objectContaining ( { 
206-         action : DiffAction . add , 
207-         afterValue : 'Pet successfully added' , 
208-         afterDeclarationPaths : [ [ 
209-           ...COMPONENTS_RESPONSE_PATH , 
210-           'description' , 
211-         ] ] , 
212-         type : ClassifierType . annotation , 
213-       } ) , 
214-     ] ) ) 
215-   } ) 
21685} ) 
0 commit comments