-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fixing key-value after adding version (#3093)
- Loading branch information
1 parent
01bc0e8
commit c13d83b
Showing
6 changed files
with
70 additions
and
6 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
...ile/__tests__/translateFieldPath.test.tsx → ...ests__/schema/translateFieldPath.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ests__/translateFieldPathSegment.test.tsx → ...schema/translateFieldPathSegment.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
datahub-web-react/src/app/entity/dataset/profile/__tests__/schema/utils.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import { SchemaFieldDataType } from '../../../../../../types.generated'; | ||
import { filterKeyFieldPath } from '../../schema/utils/utils'; | ||
|
||
describe('utils', () => { | ||
describe('filterKeyFieldPath', () => { | ||
it('allows keys when looking for keys', () => { | ||
expect( | ||
filterKeyFieldPath(true, { | ||
fieldPath: '[version=2.0].[key=True].[type=long].field', | ||
nullable: false, | ||
type: SchemaFieldDataType.Number, | ||
recursive: false, | ||
}), | ||
).toEqual(true); | ||
}); | ||
it('blocks non-keys when looking for keys', () => { | ||
expect( | ||
filterKeyFieldPath(true, { | ||
fieldPath: '[version=2.0].[type=long].field', | ||
nullable: false, | ||
type: SchemaFieldDataType.Number, | ||
recursive: false, | ||
}), | ||
).toEqual(false); | ||
}); | ||
|
||
it('allows non-keys when looking for non-keys', () => { | ||
expect( | ||
filterKeyFieldPath(false, { | ||
fieldPath: '[version=2.0].[type=long].field', | ||
nullable: false, | ||
type: SchemaFieldDataType.Number, | ||
recursive: false, | ||
}), | ||
).toEqual(true); | ||
}); | ||
|
||
it('blocks keys when looking for non-keys', () => { | ||
expect( | ||
filterKeyFieldPath(false, { | ||
fieldPath: '[version=2.0].[key=True].[type=long].field', | ||
nullable: false, | ||
type: SchemaFieldDataType.Number, | ||
recursive: false, | ||
}), | ||
).toEqual(false); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters