-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(core/reports): enable variables in indicator expressions
- Loading branch information
Showing
3 changed files
with
190 additions
and
138 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
21 changes: 21 additions & 0 deletions
21
projects/core/reports/src/xls-report/hindikit-parser.spec.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,21 @@ | ||
import {indicatorToJs} from './hindikit-parser'; | ||
|
||
describe('indicatorToJs', () => { | ||
const indicator1 = 'SUM(forms, $pippo, $name = pluto)'; | ||
it(indicator1, () => { | ||
const result = indicatorToJs(indicator1); | ||
expect(result).toBe('SUM.call({pluto}, forms, "pippo", "name === pluto")'); | ||
}); | ||
|
||
const indicator2 = 'SUM(forms, $pippo)'; | ||
it(indicator2, () => { | ||
const result = indicatorToJs(indicator2); | ||
expect(result).toBe('SUM(forms, "pippo")'); | ||
}); | ||
|
||
const indicator3 = '[forms[0], 4+(5), IF_THEN_ELSE(foo, pippo, pluto)]'; | ||
it(indicator3, () => { | ||
const result = indicatorToJs(indicator3); | ||
expect(result).toBe('[forms[0], 4 + (5), (foo ? pippo : pluto)]'); | ||
}); | ||
}); |
Oops, something went wrong.