forked from apache/superset
-
Notifications
You must be signed in to change notification settings - Fork 4
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
1 parent
f1164ae
commit 75a11b0
Showing
2 changed files
with
14 additions
and
1 deletion.
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 |
---|---|---|
|
@@ -18,7 +18,7 @@ before_script: | |
- yarn build | ||
|
||
script: | ||
- yarn lint | ||
- yarn test | ||
|
||
after_script: | ||
- codecov |
13 changes: 13 additions & 0 deletions
13
...lugins/packages/superset-ui-preset-chart-xy/test/encodeable/parsers/extractGetter.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,13 @@ | ||
import extractGetter from '../../../src/encodeable/parsers/extractGetter'; | ||
|
||
describe('extractGetter', () => { | ||
it('extract getter from ValueDef { value: "abc" }', () => { | ||
const getter = extractGetter({ value: 'abc' }); | ||
expect(getter(undefined)).toEqual('abc'); | ||
}); | ||
|
||
it('extract getter from FieldDef { field: "fieldName" }', () => { | ||
const getter = extractGetter({ field: 'age' }); | ||
expect(getter({ age: 10 })).toEqual(10); | ||
}); | ||
}); |