-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
psp-7082 ensure that primary contact logic for org teams works when t…
…here is no org primary contact available.
- Loading branch information
1 parent
16400dc
commit b86a3ed
Showing
2 changed files
with
22 additions
and
1 deletion.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
source/frontend/src/features/mapSideBar/acquisition/common/models.test.ts
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,21 @@ | ||
import { AcquisitionTeamFormModel } from './models'; | ||
|
||
describe('acquisition model tests', () => { | ||
it('omits the primary contact if unset', () => { | ||
let model = new AcquisitionTeamFormModel('testType'); | ||
model.primaryContactId = ''; | ||
expect(model.toApi(1)?.primaryContactId).toBeUndefined(); | ||
}); | ||
|
||
it('omits the primary contact if null', () => { | ||
let model = new AcquisitionTeamFormModel('testType'); | ||
model.primaryContactId = null as any; | ||
expect(model.toApi(1)?.primaryContactId).toBeUndefined(); | ||
}); | ||
|
||
it('omits the primary contact if undefined', () => { | ||
let model = new AcquisitionTeamFormModel('testType'); | ||
model.primaryContactId = undefined as any; | ||
expect(model.toApi(1)?.primaryContactId).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