This repository has been archived by the owner on Jan 19, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 486
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix bug where actions are not passed to components
Signed-off-by: Sam Foo <foos@vmware.com>
- Loading branch information
Sam Foo
committed
May 28, 2021
1 parent
7cd91ef
commit 753b5df
Showing
3 changed files
with
76 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 @@ | ||
Fixed bug where actions were not passed to components |
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,69 @@ | ||
import { FormHelper } from './form-helper'; | ||
|
||
describe('FormHelper', () => { | ||
let formHelper: FormHelper; | ||
|
||
beforeEach(() => { | ||
formHelper = new FormHelper(); | ||
}); | ||
|
||
it('converts number', () => { | ||
expect( | ||
formHelper.transformValue({ | ||
configuration: null, | ||
value: 3, | ||
name: '', | ||
type: 'number', | ||
error: null, | ||
label: null, | ||
placeholder: null, | ||
validators: null, | ||
}) | ||
).toEqual(3); | ||
}); | ||
|
||
it('converts stringed number', () => { | ||
expect( | ||
formHelper.transformValue({ | ||
configuration: null, | ||
value: '123', | ||
name: '', | ||
type: 'number', | ||
error: null, | ||
label: null, | ||
placeholder: null, | ||
validators: null, | ||
}) | ||
).toEqual(123); | ||
}); | ||
|
||
it('converts text', () => { | ||
expect( | ||
formHelper.transformValue({ | ||
configuration: null, | ||
value: 'hello', | ||
name: '', | ||
type: 'text', | ||
error: null, | ||
label: null, | ||
placeholder: null, | ||
validators: null, | ||
}) | ||
).toEqual('hello'); | ||
}); | ||
|
||
it('converts NaN', () => { | ||
expect( | ||
formHelper.transformValue({ | ||
configuration: null, | ||
value: NaN, | ||
name: '', | ||
type: 'number', | ||
error: null, | ||
label: null, | ||
placeholder: null, | ||
validators: null, | ||
}) | ||
).toEqual(0); | ||
}); | ||
}); |
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