Skip to content

Commit

Permalink
scenario: update test of jr:count value coercsion
Browse files Browse the repository at this point in the history
Update is consistent with getodk/javarosa#789
  • Loading branch information
eyelidlessness committed Dec 12, 2024
1 parent 7feee92 commit 5743238
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions packages/scenario/test/actions-events.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,16 @@ describe('Actions/Events', () => {
/**
* **PORTING NOTES**
*
* This test previously had a confusing assertion: setting a value
* referenced by a `jr:count` expression to "1" (as a string value) would
* produce a value of 0 (as a number value) for that expression. This
* reflected the behavior in JavaRosa at the time, rather than the intent of
* the test. The behavior and test were corrected after this test was
* ported, in {@link https://github.com/getodk/javarosa/pull/789}. Our port
* has been updated accordingly.
*
* - - -
*
* 1. None of this test feels like it has anything to do with
* actions/events, `odk-new-repeat` specifically, or really anything in
* this module/suite/bag/vat other than loading the same fixture.
Expand Down Expand Up @@ -660,7 +670,7 @@ describe('Actions/Events', () => {
* form-definition-validity.test.ts.
*/
describe('set [value other than integer] other than integer value, on repeat with count', () => {
it.fails('converts [the count-setting]', async () => {
it('converts [the count-setting]', async () => {
const scenario = await Scenario.init(r('event-odk-new-repeat.xml'));

// String
Expand All @@ -670,7 +680,7 @@ describe('Actions/Events', () => {
// scenario.next();
// }

expect(scenario.countRepeatInstancesOf('/data/my-jr-count-repeat')).toBe(0);
expect(scenario.countRepeatInstancesOf('/data/my-jr-count-repeat')).toBe(1);

// Decimal
scenario.jumpToBeginningOfForm();
Expand Down

0 comments on commit 5743238

Please sign in to comment.