|
1 | 1 | import { compareFiles, TEST_DEFAULTS_DECLARATION_PATHS } from '../utils' |
2 | 2 | import { diffsMatcher } from '../../helper/matchers' |
3 | | -import { annotation, breaking, DiffAction, nonBreaking, risky } from '../../../src' |
| 3 | +import { annotation, breaking, DiffAction, nonBreaking, risky, unclassified } from '../../../src' |
4 | 4 | import { TEST_SPEC_TYPE_GRAPH_QL } from '@netcracker/qubership-apihub-compatibility-suites' |
5 | 5 | import { COMPARE_SCOPE_OUTPUT } from '../../../src/graphapi' |
6 | 6 |
|
@@ -49,6 +49,25 @@ describe('GraphQL Object Output Type of Root Type', () => { |
49 | 49 | }), |
50 | 50 | ])) |
51 | 51 | }) |
| 52 | + test('Change field type of output object type from enum to string', async () => { |
| 53 | + const testId = 'change-field-type-of-output-object-type-from-enum-to-string' |
| 54 | + const result = await compareFiles(SUITE_ID, testId, TEST_SPEC_TYPE_GRAPH_QL) |
| 55 | + expect(result).toEqual(diffsMatcher([ |
| 56 | + expect.objectContaining({ |
| 57 | + action: DiffAction.replace, |
| 58 | + //beforeDeclarationPaths: [[...COMPONENT_PATH, 'type', 'methods', 'name', 'output', 'typeDef', 'type']], // TODO: fix before declaration paths |
| 59 | + afterDeclarationPaths: [[...COMPONENT_PATH, 'type', 'methods', 'name', 'output', 'typeDef', 'type']], |
| 60 | + type: breaking, |
| 61 | + scope: COMPARE_SCOPE_OUTPUT |
| 62 | + }), |
| 63 | + expect.objectContaining({ |
| 64 | + action: DiffAction.remove, |
| 65 | + // beforeDeclarationPaths: [[...ENUM_PATH]], // TODO: fix before declaration paths |
| 66 | + type: unclassified, |
| 67 | + scope: COMPARE_SCOPE_OUTPUT |
| 68 | + }), |
| 69 | + ])) |
| 70 | + }) |
52 | 71 | test('Add new field in output object type', async () => { |
53 | 72 | const testId = 'add-new-field-in-output-object-type' |
54 | 73 | const result = await compareFiles(SUITE_ID, testId, TEST_SPEC_TYPE_GRAPH_QL) |
|
0 commit comments