Skip to content

Commit 41c597f

Browse files
committed
chore: merge with branch
1 parent 1d97203 commit 41c597f

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

test/bugs.test.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ import changeToNothingClassificationAfter from './helper/resources/change-to-not
2727
import spearedParamsBefore from './helper/resources/speared-parameters/before.json'
2828
import spearedParamsAfter from './helper/resources/speared-parameters/after.json'
2929

30+
import wildcardContentSchemaMediaTypeCombinedWithSpecificMediaTypeBefore from './helper/resources/wildcard-content-schema-media-type-combined-with-specific-media-type/before.json'
31+
import wildcardContentSchemaMediaTypeCombinedWithSpecificMediaTypeAfter from './helper/resources/wildcard-content-schema-media-type-combined-with-specific-media-type/after.json'
32+
33+
3034
import { diffsMatcher } from './helper/matchers'
3135
import { TEST_DIFF_FLAG, TEST_ORIGINS_FLAG } from './helper'
3236
import { JSON_SCHEMA_NODE_SYNTHETIC_TYPE_NOTHING } from '@netcracker/qubership-apihub-api-unifier'
@@ -216,4 +220,20 @@ describe('Real Data', () => {
216220
const { diffs } = apiDiff(before, after, OPTIONS)
217221
expect(diffs).toBeEmpty()
218222
})
223+
224+
// The original issue was that media type was reported as added/removed, when nothing actually changed
225+
it('wildcard content schema media type in combination with specific media type', () => {
226+
const before: any = wildcardContentSchemaMediaTypeCombinedWithSpecificMediaTypeBefore
227+
const after: any = wildcardContentSchemaMediaTypeCombinedWithSpecificMediaTypeAfter
228+
const { diffs } = apiDiff(before, after, OPTIONS)
229+
230+
expect(diffs).toEqual(diffsMatcher([
231+
expect.objectContaining({
232+
action: DiffAction.replace,
233+
beforeDeclarationPaths: [['servers', 0, 'url']],
234+
afterDeclarationPaths: [['servers', 0, 'url']],
235+
type: annotation,
236+
}),
237+
]))
238+
})
219239
})

0 commit comments

Comments
 (0)