Skip to content

Commit 62aed7e

Browse files
committed
feat: Fixed paths
1 parent 5ee5a96 commit 62aed7e

File tree

8 files changed

+64
-65
lines changed

8 files changed

+64
-65
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { runRefObjectDescriptionTests } from './templates/reference-object-31.template'
22

33
const SUITE_ID = 'headers'
4-
const PATH_TO_HEADER_DESCRIPTION = ['paths', '/path1', 'get', 'responses', '200', 'headers', 'X-Rate-Limit', 'description']
5-
const PATH_TO_COMPONENT_DESCRIPTION = ['components', 'headers', 'X-Rate-Limit', 'description']
4+
const HEADER_PATH = ['paths', '/path1', 'get', 'responses', '200', 'headers', 'X-Rate-Limit']
5+
const COMPONENTS_HEADER_PATH = ['components', 'headers', 'X-Rate-Limit']
66

77
describe('Reference object. Headers. Description fields in ref object', () => {
8-
runRefObjectDescriptionTests(SUITE_ID, PATH_TO_HEADER_DESCRIPTION, PATH_TO_COMPONENT_DESCRIPTION)
8+
runRefObjectDescriptionTests(SUITE_ID, HEADER_PATH, COMPONENTS_HEADER_PATH)
99
})

test/compatibility-suites/openapi/operation-parameters.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -725,7 +725,7 @@ describe('Openapi3 Operation Parameters', () => {
725725
})
726726
})
727727

728-
const PATH_TO_COMPONENT_DESCRIPTION = ['components', 'parameters', 'status', 'description']
728+
const COMPONENTS_OPERATION_PARAMETER_PATH = ['components', 'parameters', 'status']
729729
describe('Reference object. Operation parameters. Description fields in ref object', () => {
730-
runRefObjectDescriptionTests(SUITE_ID, [...OPERATION_PARAMETERS_PATH, 0, 'description'], PATH_TO_COMPONENT_DESCRIPTION)
730+
runRefObjectDescriptionTests(SUITE_ID, [...OPERATION_PARAMETERS_PATH, 0], COMPONENTS_OPERATION_PARAMETER_PATH)
731731
})

test/compatibility-suites/openapi/parameters-examples.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,9 @@ describe('Openapi3 Parameters Examples', () => {
163163
})
164164
})
165165

166-
const PATH_TO_COMPONENTS = ['components', 'examples', 'ex1']
166+
const COMPONENTS_PARAMETERS_EXAMPLE_PATH = ['components', 'examples', 'ex1']
167167
describe('Reference object. Parameters examples. Description and Summary fields in ref object', () => {
168-
runRefObjectDescriptionTests(SUITE_ID, [...PARAMETERS_EXAMPLES_PATH, 'ex1', 'description'], [...PATH_TO_COMPONENTS, 'description'])
169-
runRefObjectSummaryTests(SUITE_ID, [...PARAMETERS_EXAMPLES_PATH, 'ex1', 'summary'], [...PATH_TO_COMPONENTS, 'summary'])
168+
runRefObjectDescriptionTests(SUITE_ID, [...PARAMETERS_EXAMPLES_PATH, 'ex1'], COMPONENTS_PARAMETERS_EXAMPLE_PATH)
169+
runRefObjectSummaryTests(SUITE_ID, [...PARAMETERS_EXAMPLES_PATH, 'ex1'], COMPONENTS_PARAMETERS_EXAMPLE_PATH)
170170
})
171171

test/compatibility-suites/openapi/request-body-examples.test.ts

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { runRefObjectDescriptionTests } from './templates/reference-object-31.te
55

66
const SUITE_ID = 'request-body-examples'
77

8-
const REQUEST_BODY_PATH = ['paths', '/path1', 'post', 'requestBody', 'content', 'application/json', 'examples']
8+
const REQUEST_BODY_CONTENT_EXAMPLES_PATH = ['paths', '/path1', 'post', 'requestBody', 'content', 'application/json', 'examples']
99

1010
describe('Openapi3 Request Body Examples', () => {
1111

@@ -15,7 +15,7 @@ describe('Openapi3 Request Body Examples', () => {
1515
expect(result).toEqual(diffsMatcher([
1616
expect.objectContaining({
1717
action: DiffAction.add,
18-
afterDeclarationPaths: [[...REQUEST_BODY_PATH, 'example1']],
18+
afterDeclarationPaths: [[...REQUEST_BODY_CONTENT_EXAMPLES_PATH, 'example1']],
1919
type: annotation,
2020
}),
2121
]))
@@ -27,7 +27,7 @@ describe('Openapi3 Request Body Examples', () => {
2727
expect(result).toEqual(diffsMatcher([
2828
expect.objectContaining({
2929
action: DiffAction.add,
30-
afterDeclarationPaths: [[...REQUEST_BODY_PATH, 'example2']],
30+
afterDeclarationPaths: [[...REQUEST_BODY_CONTENT_EXAMPLES_PATH, 'example2']],
3131
type: annotation,
3232
}),
3333
]))
@@ -39,8 +39,8 @@ describe('Openapi3 Request Body Examples', () => {
3939
expect(result).toEqual(diffsMatcher([
4040
expect.objectContaining({
4141
action: DiffAction.replace,
42-
beforeDeclarationPaths: [[...REQUEST_BODY_PATH, 'example1', 'value']],
43-
afterDeclarationPaths: [[...REQUEST_BODY_PATH, 'example1', 'value']],
42+
beforeDeclarationPaths: [[...REQUEST_BODY_CONTENT_EXAMPLES_PATH, 'example1', 'value']],
43+
afterDeclarationPaths: [[...REQUEST_BODY_CONTENT_EXAMPLES_PATH, 'example1', 'value']],
4444
type: annotation,
4545
}),
4646
]))
@@ -52,12 +52,12 @@ describe('Openapi3 Request Body Examples', () => {
5252
expect(result).toEqual(diffsMatcher([
5353
expect.objectContaining({
5454
action: DiffAction.remove,
55-
beforeDeclarationPaths: [[...REQUEST_BODY_PATH, 'example1']],
55+
beforeDeclarationPaths: [[...REQUEST_BODY_CONTENT_EXAMPLES_PATH, 'example1']],
5656
type: annotation,
5757
}),
5858
expect.objectContaining({
5959
action: DiffAction.add,
60-
afterDeclarationPaths: [[...REQUEST_BODY_PATH, 'example0']],
60+
afterDeclarationPaths: [[...REQUEST_BODY_CONTENT_EXAMPLES_PATH, 'example0']],
6161
type: annotation,
6262
}),
6363
]))
@@ -69,8 +69,8 @@ describe('Openapi3 Request Body Examples', () => {
6969
expect(result).toEqual(diffsMatcher([
7070
expect.objectContaining({
7171
action: DiffAction.replace,
72-
beforeDeclarationPaths: [[...REQUEST_BODY_PATH, 'example1', 'externalValue']],
73-
afterDeclarationPaths: [[...REQUEST_BODY_PATH, 'example1', 'externalValue']],
72+
beforeDeclarationPaths: [[...REQUEST_BODY_CONTENT_EXAMPLES_PATH, 'example1', 'externalValue']],
73+
afterDeclarationPaths: [[...REQUEST_BODY_CONTENT_EXAMPLES_PATH, 'example1', 'externalValue']],
7474
type: annotation,
7575
}),
7676
]))
@@ -82,7 +82,7 @@ describe('Openapi3 Request Body Examples', () => {
8282
expect(result).toEqual(diffsMatcher([
8383
expect.objectContaining({
8484
action: DiffAction.remove,
85-
beforeDeclarationPaths: [[...REQUEST_BODY_PATH, 'example1', 'externalValue']],
85+
beforeDeclarationPaths: [[...REQUEST_BODY_CONTENT_EXAMPLES_PATH, 'example1', 'externalValue']],
8686
type: annotation,
8787
}),
8888
]))
@@ -94,7 +94,7 @@ describe('Openapi3 Request Body Examples', () => {
9494
expect(result).toEqual(diffsMatcher([
9595
expect.objectContaining({
9696
action: DiffAction.add,
97-
afterDeclarationPaths: [[...REQUEST_BODY_PATH, 'example1', 'summary']],
97+
afterDeclarationPaths: [[...REQUEST_BODY_CONTENT_EXAMPLES_PATH, 'example1', 'summary']],
9898
type: annotation,
9999
}),
100100
]))
@@ -106,8 +106,8 @@ describe('Openapi3 Request Body Examples', () => {
106106
expect(result).toEqual(diffsMatcher([
107107
expect.objectContaining({
108108
action: DiffAction.replace,
109-
beforeDeclarationPaths: [[...REQUEST_BODY_PATH, 'example1', 'summary']],
110-
afterDeclarationPaths: [[...REQUEST_BODY_PATH, 'example1', 'summary']],
109+
beforeDeclarationPaths: [[...REQUEST_BODY_CONTENT_EXAMPLES_PATH, 'example1', 'summary']],
110+
afterDeclarationPaths: [[...REQUEST_BODY_CONTENT_EXAMPLES_PATH, 'example1', 'summary']],
111111
type: annotation,
112112
}),
113113
]))
@@ -119,7 +119,7 @@ describe('Openapi3 Request Body Examples', () => {
119119
expect(result).toEqual(diffsMatcher([
120120
expect.objectContaining({
121121
action: DiffAction.remove,
122-
beforeDeclarationPaths: [[...REQUEST_BODY_PATH, 'example1', 'summary']],
122+
beforeDeclarationPaths: [[...REQUEST_BODY_CONTENT_EXAMPLES_PATH, 'example1', 'summary']],
123123
type: annotation,
124124
}),
125125
]))
@@ -131,7 +131,7 @@ describe('Openapi3 Request Body Examples', () => {
131131
expect(result).toEqual(diffsMatcher([
132132
expect.objectContaining({
133133
action: DiffAction.add,
134-
afterDeclarationPaths: [[...REQUEST_BODY_PATH, 'example1', 'description']],
134+
afterDeclarationPaths: [[...REQUEST_BODY_CONTENT_EXAMPLES_PATH, 'example1', 'description']],
135135
type: annotation,
136136
}),
137137
]))
@@ -143,8 +143,8 @@ describe('Openapi3 Request Body Examples', () => {
143143
expect(result).toEqual(diffsMatcher([
144144
expect.objectContaining({
145145
action: DiffAction.replace,
146-
beforeDeclarationPaths: [[...REQUEST_BODY_PATH, 'example1', 'description']],
147-
afterDeclarationPaths: [[...REQUEST_BODY_PATH, 'example1', 'description']],
146+
beforeDeclarationPaths: [[...REQUEST_BODY_CONTENT_EXAMPLES_PATH, 'example1', 'description']],
147+
afterDeclarationPaths: [[...REQUEST_BODY_CONTENT_EXAMPLES_PATH, 'example1', 'description']],
148148
type: annotation,
149149
}),
150150
]))
@@ -156,15 +156,14 @@ describe('Openapi3 Request Body Examples', () => {
156156
expect(result).toEqual(diffsMatcher([
157157
expect.objectContaining({
158158
action: DiffAction.remove,
159-
beforeDeclarationPaths: [[...REQUEST_BODY_PATH, 'example1', 'description']],
159+
beforeDeclarationPaths: [[...REQUEST_BODY_CONTENT_EXAMPLES_PATH, 'example1', 'description']],
160160
type: annotation,
161161
}),
162162
]))
163163
})
164164
})
165165

166-
const PATH_TO_COMPONENTS_DESCRIPTION = ['components', 'examples', 'ex1', 'description']
167-
166+
const COMPONENTS_EXAMPLES_PATH = ['components', 'examples', 'ex1']
168167
describe('Reference object. Request body examples. Description fields in ref object', () => {
169-
runRefObjectDescriptionTests(SUITE_ID, [...REQUEST_BODY_PATH, 'ex1', 'description'], PATH_TO_COMPONENTS_DESCRIPTION)
168+
runRefObjectDescriptionTests(SUITE_ID, [...REQUEST_BODY_CONTENT_EXAMPLES_PATH, 'ex1'], COMPONENTS_EXAMPLES_PATH)
170169
})
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { runRefObjectDescriptionTests } from './templates/reference-object-31.template'
22

33
const SUITE_ID = 'request-body'
4-
const PATH_TO_HEADER_DESCRIPTION = ['paths', '/path1', 'post', 'requestBody', 'description']
5-
const PATH_TO_COMPONENTS_DESCRIPTION = ['components', 'requestBodies', 'rb1', 'description']
4+
const REQUEST_BODY_PATH = ['paths', '/path1', 'post', 'requestBody']
5+
const COMPONENTS_REQUEST_BODY_PATH = ['components', 'requestBodies', 'rb1']
66

77
describe('Reference object. Request body. Description fields in ref object', () => {
8-
runRefObjectDescriptionTests(SUITE_ID, PATH_TO_HEADER_DESCRIPTION, PATH_TO_COMPONENTS_DESCRIPTION)
8+
runRefObjectDescriptionTests(SUITE_ID, REQUEST_BODY_PATH, COMPONENTS_REQUEST_BODY_PATH)
99
})

test/compatibility-suites/openapi/response-body-examples.test.ts

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { runRefObjectDescriptionTests } from './templates/reference-object-31.te
55

66
const SUITE_ID = 'response-body-examples'
77

8-
const COMMON_PATH = ['paths', '/path1', 'post', 'responses', '200', 'content', 'application/json', 'examples']
8+
const RESPONSE_CONTENT_EXAMPLES_PATH = ['paths', '/path1', 'post', 'responses', '200', 'content', 'application/json', 'examples']
99

1010
describe('Openapi3 Response Body Examples', () => {
1111

@@ -15,7 +15,7 @@ describe('Openapi3 Response Body Examples', () => {
1515
expect(result).toEqual(diffsMatcher([
1616
expect.objectContaining({
1717
action: DiffAction.add,
18-
afterDeclarationPaths: [[...COMMON_PATH, 'example1']],
18+
afterDeclarationPaths: [[...RESPONSE_CONTENT_EXAMPLES_PATH, 'example1']],
1919
type: annotation,
2020
}),
2121
]))
@@ -27,7 +27,7 @@ describe('Openapi3 Response Body Examples', () => {
2727
expect(result).toEqual(diffsMatcher([
2828
expect.objectContaining({
2929
action: DiffAction.add,
30-
afterDeclarationPaths: [[...COMMON_PATH, 'example2']],
30+
afterDeclarationPaths: [[...RESPONSE_CONTENT_EXAMPLES_PATH, 'example2']],
3131
type: annotation,
3232
}),
3333
]))
@@ -39,8 +39,8 @@ describe('Openapi3 Response Body Examples', () => {
3939
expect(result).toEqual(diffsMatcher([
4040
expect.objectContaining({
4141
action: DiffAction.replace,
42-
beforeDeclarationPaths: [[...COMMON_PATH, 'example1', 'value']],
43-
afterDeclarationPaths: [[...COMMON_PATH, 'example1', 'value']],
42+
beforeDeclarationPaths: [[...RESPONSE_CONTENT_EXAMPLES_PATH, 'example1', 'value']],
43+
afterDeclarationPaths: [[...RESPONSE_CONTENT_EXAMPLES_PATH, 'example1', 'value']],
4444
type: annotation,
4545
}),
4646
]))
@@ -52,12 +52,12 @@ describe('Openapi3 Response Body Examples', () => {
5252
expect(result).toEqual(diffsMatcher([
5353
expect.objectContaining({
5454
action: DiffAction.remove,
55-
beforeDeclarationPaths: [[...COMMON_PATH, 'example1']],
55+
beforeDeclarationPaths: [[...RESPONSE_CONTENT_EXAMPLES_PATH, 'example1']],
5656
type: annotation,
5757
}),
5858
expect.objectContaining({
5959
action: DiffAction.add,
60-
afterDeclarationPaths: [[...COMMON_PATH, 'example0']],
60+
afterDeclarationPaths: [[...RESPONSE_CONTENT_EXAMPLES_PATH, 'example0']],
6161
type: annotation,
6262
}),
6363
]))
@@ -69,8 +69,8 @@ describe('Openapi3 Response Body Examples', () => {
6969
expect(result).toEqual(diffsMatcher([
7070
expect.objectContaining({
7171
action: DiffAction.replace,
72-
beforeDeclarationPaths: [[...COMMON_PATH, 'example1', 'externalValue']],
73-
afterDeclarationPaths: [[...COMMON_PATH, 'example1', 'externalValue']],
72+
beforeDeclarationPaths: [[...RESPONSE_CONTENT_EXAMPLES_PATH, 'example1', 'externalValue']],
73+
afterDeclarationPaths: [[...RESPONSE_CONTENT_EXAMPLES_PATH, 'example1', 'externalValue']],
7474
type: annotation,
7575
}),
7676
]))
@@ -82,7 +82,7 @@ describe('Openapi3 Response Body Examples', () => {
8282
expect(result).toEqual(diffsMatcher([
8383
expect.objectContaining({
8484
action: DiffAction.remove,
85-
beforeDeclarationPaths: [[...COMMON_PATH, 'example1', 'externalValue']],
85+
beforeDeclarationPaths: [[...RESPONSE_CONTENT_EXAMPLES_PATH, 'example1', 'externalValue']],
8686
type: annotation,
8787
}),
8888
]))
@@ -94,7 +94,7 @@ describe('Openapi3 Response Body Examples', () => {
9494
expect(result).toEqual(diffsMatcher([
9595
expect.objectContaining({
9696
action: DiffAction.add,
97-
afterDeclarationPaths: [[...COMMON_PATH, 'example1', 'summary']],
97+
afterDeclarationPaths: [[...RESPONSE_CONTENT_EXAMPLES_PATH, 'example1', 'summary']],
9898
type: annotation,
9999
}),
100100
]))
@@ -106,8 +106,8 @@ describe('Openapi3 Response Body Examples', () => {
106106
expect(result).toEqual(diffsMatcher([
107107
expect.objectContaining({
108108
action: DiffAction.replace,
109-
beforeDeclarationPaths: [[...COMMON_PATH, 'example1', 'summary']],
110-
afterDeclarationPaths: [[...COMMON_PATH, 'example1', 'summary']],
109+
beforeDeclarationPaths: [[...RESPONSE_CONTENT_EXAMPLES_PATH, 'example1', 'summary']],
110+
afterDeclarationPaths: [[...RESPONSE_CONTENT_EXAMPLES_PATH, 'example1', 'summary']],
111111
type: annotation,
112112
}),
113113
]))
@@ -119,7 +119,7 @@ describe('Openapi3 Response Body Examples', () => {
119119
expect(result).toEqual(diffsMatcher([
120120
expect.objectContaining({
121121
action: DiffAction.remove,
122-
beforeDeclarationPaths: [[...COMMON_PATH, 'example1', 'summary']],
122+
beforeDeclarationPaths: [[...RESPONSE_CONTENT_EXAMPLES_PATH, 'example1', 'summary']],
123123
type: annotation,
124124
}),
125125
]))
@@ -131,7 +131,7 @@ describe('Openapi3 Response Body Examples', () => {
131131
expect(result).toEqual(diffsMatcher([
132132
expect.objectContaining({
133133
action: DiffAction.add,
134-
afterDeclarationPaths: [[...COMMON_PATH, 'example1', 'description']],
134+
afterDeclarationPaths: [[...RESPONSE_CONTENT_EXAMPLES_PATH, 'example1', 'description']],
135135
type: annotation,
136136
}),
137137
]))
@@ -143,8 +143,8 @@ describe('Openapi3 Response Body Examples', () => {
143143
expect(result).toEqual(diffsMatcher([
144144
expect.objectContaining({
145145
action: DiffAction.replace,
146-
beforeDeclarationPaths: [[...COMMON_PATH, 'example1', 'description']],
147-
afterDeclarationPaths: [[...COMMON_PATH, 'example1', 'description']],
146+
beforeDeclarationPaths: [[...RESPONSE_CONTENT_EXAMPLES_PATH, 'example1', 'description']],
147+
afterDeclarationPaths: [[...RESPONSE_CONTENT_EXAMPLES_PATH, 'example1', 'description']],
148148
type: annotation,
149149
}),
150150
]))
@@ -156,14 +156,14 @@ describe('Openapi3 Response Body Examples', () => {
156156
expect(result).toEqual(diffsMatcher([
157157
expect.objectContaining({
158158
action: DiffAction.remove,
159-
beforeDeclarationPaths: [[...COMMON_PATH, 'example1', 'description']],
159+
beforeDeclarationPaths: [[...RESPONSE_CONTENT_EXAMPLES_PATH, 'example1', 'description']],
160160
type: annotation,
161161
}),
162162
]))
163163
})
164164
})
165165

166-
const PATH_TO_COMPONENTS_DESCRIPTION = ['components', 'examples', 'ex1', 'description']
166+
const COMPONENTS_EXAMPLES_PATH = ['components', 'examples', 'ex1']
167167
describe('Reference object. Response body examples. Description fields in ref object', () => {
168-
runRefObjectDescriptionTests(SUITE_ID, [...COMMON_PATH, 'ex1', 'description'], PATH_TO_COMPONENTS_DESCRIPTION)
168+
runRefObjectDescriptionTests(SUITE_ID, [...RESPONSE_CONTENT_EXAMPLES_PATH, 'ex1'], COMPONENTS_EXAMPLES_PATH)
169169
})

test/compatibility-suites/openapi/response.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ describe('Openapi3 Response', () => {
255255
})
256256

257257
const RESPONSES_POST_PATH = ['paths', '/path1', 'post', 'responses']
258-
const PATH_TO_COMPONENTS_DESCRIPTION = ['components', 'responses', 'response200', 'description']
258+
const COMPONENTS_RESPONSE_PATH = ['components', 'responses', 'response200']
259259
describe('Reference object. Response. Description fields in ref object', () => {
260-
runRefObjectDescriptionTests(SUITE_ID, [...RESPONSES_POST_PATH, '200', 'description'], PATH_TO_COMPONENTS_DESCRIPTION)
260+
runRefObjectDescriptionTests(SUITE_ID, [...RESPONSES_POST_PATH, '200'], COMPONENTS_RESPONSE_PATH)
261261
})

test/compatibility-suites/openapi/templates/reference-object-31.template.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,23 @@ const enum OverridenFields {
88
SUMMARY = 'summary'
99
}
1010

11-
export function runRefObjectDescriptionTests(suiteId: string, commonPath: JsonPath, componentPath: JsonPath): void {
12-
runReferenceObjectTests(suiteId, commonPath, componentPath, OverridenFields.DESCRIPTION)
11+
export function runRefObjectDescriptionTests(suiteId: string, refPath: JsonPath, componentPath: JsonPath): void {
12+
runReferenceObjectTests(suiteId, refPath, componentPath, OverridenFields.DESCRIPTION)
1313
}
1414

15-
export function runRefObjectSummaryTests(suiteId: string, commonPath: JsonPath, componentPath: JsonPath): void {
16-
runReferenceObjectTests(suiteId, commonPath, componentPath, OverridenFields.SUMMARY)
15+
export function runRefObjectSummaryTests(suiteId: string, refPath: JsonPath, componentPath: JsonPath): void {
16+
runReferenceObjectTests(suiteId, refPath, componentPath, OverridenFields.SUMMARY)
1717
}
1818

19-
function runReferenceObjectTests(suiteId: string, commonPath: JsonPath, componentPath: JsonPath, overridenField: OverridenFields): void {
19+
export function runReferenceObjectTests(suiteId: string, refPath: JsonPath, componentPath: JsonPath, overridenField: OverridenFields): void {
2020
test(`Add overriden ${overridenField}`, async () => {
2121
const testId = `add-overriden-${overridenField}`
2222
const result = await compareFiles(suiteId, testId)
2323
expect(result).toEqual(diffsMatcher([
2424
expect.objectContaining({
2525
action: DiffAction.replace,
26-
afterDeclarationPaths: [commonPath],
27-
beforeDeclarationPaths: [componentPath],
26+
afterDeclarationPaths: [[...refPath , overridenField]],
27+
beforeDeclarationPaths: [[...componentPath, overridenField]],
2828
type: annotation,
2929
}),
3030
]))
@@ -36,8 +36,8 @@ function runReferenceObjectTests(suiteId: string, commonPath: JsonPath, componen
3636
expect(result).toEqual(diffsMatcher([
3737
expect.objectContaining({
3838
action: DiffAction.replace,
39-
afterDeclarationPaths: [componentPath],
40-
beforeDeclarationPaths: [commonPath],
39+
afterDeclarationPaths: [[...componentPath, overridenField]],
40+
beforeDeclarationPaths: [[...refPath , overridenField]],
4141
type: annotation,
4242
}),
4343
]))
@@ -49,8 +49,8 @@ function runReferenceObjectTests(suiteId: string, commonPath: JsonPath, componen
4949
expect(result).toEqual(diffsMatcher([
5050
expect.objectContaining({
5151
action: DiffAction.replace,
52-
afterDeclarationPaths: [commonPath],
53-
beforeDeclarationPaths: [commonPath],
52+
afterDeclarationPaths: [[...refPath , overridenField]],
53+
beforeDeclarationPaths: [[...refPath , overridenField]],
5454
type: annotation,
5555
}),
5656
]))

0 commit comments

Comments
 (0)