-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
src/components/table/__tests__/__snapshots__/tableHelpers.test.js.snap
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,22 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`TableHelpers generateTableKey should generate a variety of unique keys: keys 1`] = ` | ||
Object { | ||
"func": "table-() => 'lorem'", | ||
"nan": "table-generatedid-", | ||
"null": "table-generatedid-", | ||
"number": "table-200", | ||
"obj": "table-{\\"lorem\\":\\"ipsum\\"}", | ||
"repeatNumber": "generatedid-", | ||
"string": "table-lorem", | ||
"undefined": "table-generatedid-", | ||
} | ||
`; | ||
|
||
exports[`TableHelpers should have specific functions: tableHelpers 1`] = ` | ||
Object { | ||
"generateTableKey": [Function], | ||
"tableHeader": [Function], | ||
"tableRows": [Function], | ||
} | ||
`; |
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,20 @@ | ||
import { tableHelpers, generateTableKey, tableHeader, tableRows } from '../tableHelpers'; | ||
|
||
describe('TableHelpers', () => { | ||
it('should have specific functions', () => { | ||
expect(tableHelpers).toMatchSnapshot('tableHelpers'); | ||
}); | ||
|
||
it('generateTableKey should generate a variety of unique keys', () => { | ||
expect({ | ||
string: generateTableKey('lorem'), | ||
func: generateTableKey(() => 'lorem'), | ||
obj: generateTableKey({ lorem: 'ipsum' }), | ||
null: generateTableKey(null), | ||
undefined: generateTableKey(undefined), | ||
nan: generateTableKey(NaN), | ||
number: generateTableKey(200), | ||
repeatNumber: generateTableKey(200) | ||
}).toMatchSnapshot('keys'); | ||
}); | ||
}); |