Skip to content

Commit 093cfa3

Browse files
committed
test: add unsupported cases
1 parent 29cb21f commit 093cfa3

File tree

5 files changed

+142
-0
lines changed

5 files changed

+142
-0
lines changed

test/changes.test.ts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,36 @@ describe('Changes test', () => {
156156
[BREAKING_CHANGE_TYPE]: 1,
157157
}))
158158
})
159+
160+
// todo: case that we don't support due to shifting to the new changelog calculation approach which involves comparison of the entire docs instead of the operation vs operation comparison
161+
test.skip('Should match operations with granular servers override in method', async () => {
162+
const result = await buildChangelogPackage('changelog/mixed-cases-with-method-prefix-override')
163+
expect(result).toEqual(changesSummaryMatcher({
164+
[BREAKING_CHANGE_TYPE]: 1,
165+
[NON_BREAKING_CHANGE_TYPE]: 1,
166+
[ANNOTATION_CHANGE_TYPE]: 2, // todo: do we really need to count change in root servers[0].url in mapped operations with overridden servers?
167+
}))
168+
expect(result).toEqual(numberOfImpactedOperationsMatcher({
169+
[BREAKING_CHANGE_TYPE]: 1,
170+
[NON_BREAKING_CHANGE_TYPE]: 1,
171+
[ANNOTATION_CHANGE_TYPE]: 2, // todo: do we really need to count change in root servers[0].url in mapped operations with overridden servers?
172+
}))
173+
})
174+
175+
// todo: case that we don't support due to shifting to the new changelog calculation approach which involves comparison of the entire docs instead of the operation vs operation comparison
176+
test.skip('Should match operations with granular servers override in path', async () => {
177+
const result = await buildChangelogPackage('changelog/mixed-cases-with-path-prefix-override')
178+
expect(result).toEqual(changesSummaryMatcher({
179+
[BREAKING_CHANGE_TYPE]: 1,
180+
[NON_BREAKING_CHANGE_TYPE]: 1,
181+
[ANNOTATION_CHANGE_TYPE]: 2, // todo
182+
}))
183+
expect(result).toEqual(numberOfImpactedOperationsMatcher({
184+
[BREAKING_CHANGE_TYPE]: 1,
185+
[NON_BREAKING_CHANGE_TYPE]: 1,
186+
[ANNOTATION_CHANGE_TYPE]: 2, // todo
187+
}))
188+
})
159189
})
160190

161191
describe('Diffs collecting in the root-level properties', () => {
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
openapi: 3.0.3
2+
info:
3+
title: test
4+
version: 0.1.0
5+
servers:
6+
- url: https://example1.com/api/v4
7+
paths:
8+
/added:
9+
get:
10+
responses:
11+
'200':
12+
description: OK
13+
servers:
14+
- url: https://example1.com/api/v2
15+
/changed1:
16+
get:
17+
responses:
18+
'200':
19+
description: a2
20+
servers:
21+
- url: https://example1.com/api/v2
22+
/untouched:
23+
get:
24+
responses:
25+
'200':
26+
description: OK
27+
servers:
28+
- url: https://example1.com/api/v2
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
openapi: 3.0.3
2+
info:
3+
title: test
4+
version: 0.1.0
5+
servers:
6+
- url: https://example1.com/api/v3
7+
paths:
8+
/removed:
9+
get:
10+
responses:
11+
'200':
12+
description: OK
13+
servers:
14+
- url: https://example1.com/api/v2
15+
/changed1:
16+
get:
17+
responses:
18+
'200':
19+
description: a1
20+
servers:
21+
- url: https://example1.com/api/v2
22+
/untouched:
23+
get:
24+
responses:
25+
'200':
26+
description: OK
27+
servers:
28+
- url: https://example1.com/api/v2
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
openapi: 3.0.3
2+
info:
3+
title: test
4+
version: 0.1.0
5+
servers:
6+
- url: https://example1.com/api/v4
7+
paths:
8+
/added:
9+
get:
10+
responses:
11+
'200':
12+
description: OK
13+
servers:
14+
- url: https://example1.com/api/v2
15+
/changed1:
16+
get:
17+
responses:
18+
'200':
19+
description: a2
20+
servers:
21+
- url: https://example1.com/api/v2
22+
/untouched:
23+
get:
24+
responses:
25+
'200':
26+
description: OK
27+
servers:
28+
- url: https://example1.com/api/v2
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
openapi: 3.0.3
2+
info:
3+
title: test
4+
version: 0.1.0
5+
servers:
6+
- url: https://example1.com/api/v3
7+
paths:
8+
/removed:
9+
get:
10+
responses:
11+
'200':
12+
description: OK
13+
servers:
14+
- url: https://example1.com/api/v2
15+
/changed1:
16+
get:
17+
responses:
18+
'200':
19+
description: a1
20+
servers:
21+
- url: https://example1.com/api/v2
22+
/untouched:
23+
get:
24+
responses:
25+
'200':
26+
description: OK
27+
servers:
28+
- url: https://example1.com/api/v2

0 commit comments

Comments
 (0)