-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow nullable for TerminalSettings (#1432)
* adjusted mustache templates and created test * test fix nullable * removed nullable test * added test for terminalSettings * adjusted import for terminalSettings test * Update model.mustache removed empty line
- Loading branch information
1 parent
f7a6524
commit 38fd8e8
Showing
2 changed files
with
57 additions
and
21 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,36 @@ | ||
import { TerminalSettings } from '../typings/management/terminalSettings'; | ||
|
||
describe('TerminalSettings properties', () => { | ||
let terminalSettings: TerminalSettings; | ||
|
||
beforeEach(() => { | ||
terminalSettings = new TerminalSettings(); | ||
}); | ||
|
||
test('should allow properties to be null', () => { | ||
terminalSettings.cardholderReceipt = null; | ||
terminalSettings.connectivity = null; | ||
terminalSettings.gratuities = null; | ||
terminalSettings.hardware = null; | ||
|
||
expect(terminalSettings.cardholderReceipt).toBeNull(); | ||
expect(terminalSettings.connectivity).toBeNull(); | ||
expect(terminalSettings.gratuities).toBeNull(); | ||
expect(terminalSettings.hardware).toBeNull(); | ||
}); | ||
|
||
test('should allow properties to be undefined', () => { | ||
terminalSettings.cardholderReceipt = undefined; | ||
terminalSettings.connectivity = undefined; | ||
|
||
expect(terminalSettings.cardholderReceipt).toBeUndefined(); | ||
expect(terminalSettings.connectivity).toBeUndefined(); | ||
}); | ||
|
||
test('should allow properties to have valid type values', () => { | ||
const mockGratuities = [{ /* mock Gratuity object */ }]; | ||
terminalSettings.gratuities = mockGratuities; | ||
|
||
expect(terminalSettings.gratuities).toBe(mockGratuities); | ||
}); | ||
}); |
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