-
-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(grower): show assigned organization in overview (#178)
* refactor(growers): render orgnisation name using react component * feat(grower): add helper function that gets organisation by id * feat(grower): show assigned organisation in overview growers cards in the growers list have been enhenced to display growers assigned organization * refactor(gower): move getOrganizationById helper function to the utilities * test(utilities): add unit test for getOrganizationById utility function * feat(growers): minor enhements in displaying org own org made paler grey and in italics, a space has been added between assigned org name and id
- Loading branch information
1 parent
482fa17
commit 76c061a
Showing
5 changed files
with
86 additions
and
8 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -1,8 +1,26 @@ | ||
import { stringToSearchRegExp } from './'; | ||
import { getOrganizationById, stringToSearchRegExp } from './'; | ||
|
||
describe('converts string to regexp', () => { | ||
describe('utilities tests', () => { | ||
it('it should convert string to regexp', () => { | ||
const result = stringToSearchRegExp('test'); | ||
expect(result).toEqual(`/.*test.*/i`); | ||
}); | ||
|
||
it('it should get organization by organisation id', () => { | ||
const organizationId = 11; | ||
const organizations = [ | ||
{ | ||
id: 1, | ||
name: 'test1', | ||
type: 'O', | ||
}, | ||
{ | ||
id: 11, | ||
name: 'freetown', | ||
type: 'O', | ||
}, | ||
]; | ||
const result = getOrganizationById(organizations, organizationId); | ||
expect(result).toEqual(organizations[1]); | ||
}); | ||
}); |