-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce aliases to field rendering types (#37)
* Introduce aliases to field rendering types * Code review changes --------- Co-authored-by: Makombe <makombe>
- Loading branch information
Showing
2 changed files
with
40 additions
and
2 deletions.
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,20 @@ | ||
import { OHRIMultiSelect } from '../components/inputs/multi-select/ohri-multi-select.component'; | ||
import OHRINumber from '../components/inputs/number/ohri-number.component'; | ||
import { getFieldComponent } from './registry'; | ||
|
||
describe('registry', () => { | ||
it('should load the OHRINumber component with alias "numeric"', async () => { | ||
const result = await getFieldComponent('numeric'); | ||
expect(result).toEqual({ default: OHRINumber }); | ||
}); | ||
|
||
it('should load the OHRIMultiSelect component with alias "multiCheckbox"', async () => { | ||
const result = await getFieldComponent('multiCheckbox'); | ||
expect(result).toEqual({ default: OHRIMultiSelect }); | ||
}); | ||
|
||
it('should return undefined if no matching component is found', async () => { | ||
const result = await getFieldComponent('unknown'); | ||
expect(result).toBeUndefined(); | ||
}); | ||
}); |
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