-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(Compare Datasets Node): UI tweaks and fixes
- Loading branch information
1 parent
d47d008
commit 7ecd5e5
Showing
5 changed files
with
195 additions
and
192 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
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { fuzzyCompare } from '../../utils/utilities'; | ||
|
||
//most test cases for fuzzyCompare are done in Compare Datasets node tests | ||
describe('Test fuzzyCompare', () => { | ||
it('should do strict comparison', () => { | ||
const compareFunction = fuzzyCompare(false); | ||
|
||
expect(compareFunction(1, '1')).toEqual(false); | ||
}); | ||
|
||
it('should do fuzzy comparison', () => { | ||
const compareFunction = fuzzyCompare(true); | ||
|
||
expect(compareFunction(1, '1')).toEqual(true); | ||
}); | ||
|
||
it('should treat null, 0 and "0" as equal', () => { | ||
const compareFunction = fuzzyCompare(true, 2); | ||
|
||
expect(compareFunction(null, null)).toEqual(true); | ||
expect(compareFunction(null, 0)).toEqual(true); | ||
expect(compareFunction(null, '0')).toEqual(true); | ||
}); | ||
|
||
it('should not treat null, 0 and "0" as equal', () => { | ||
const compareFunction = fuzzyCompare(true); | ||
|
||
expect(compareFunction(null, 0)).toEqual(false); | ||
expect(compareFunction(null, '0')).toEqual(false); | ||
}); | ||
}); |
Oops, something went wrong.