-
Notifications
You must be signed in to change notification settings - Fork 13.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(tagging): change key from name to id for tagToSelectOption (#25856)
- Loading branch information
Lily Kuang
authored
Nov 6, 2023
1 parent
fb35bac
commit 30cd422
Showing
2 changed files
with
20 additions
and
1 deletion.
There are no files selected for viewing
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,19 @@ | ||
import { tagToSelectOption } from 'src/components/Tags/utils'; | ||
|
||
describe('tagToSelectOption', () => { | ||
test('converts a Tag object with table_name to a SelectTagsValue', () => { | ||
const tag = { | ||
id: '1', | ||
name: 'TagName', | ||
table_name: 'Table1', | ||
}; | ||
|
||
const expectedSelectTagsValue = { | ||
value: 'TagName', | ||
label: 'TagName', | ||
key: '1', | ||
}; | ||
|
||
expect(tagToSelectOption(tag)).toEqual(expectedSelectTagsValue); | ||
}); | ||
}); |
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