Skip to content

Commit 05a6660

Browse files
committed
add test case in scenario
1 parent 5d5c87e commit 05a6660

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

packages/scenario/test/actions-events/set-geopoint-action.test.ts

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ describe('odk:setgeopoint action', () => {
2424
},
2525
};
2626

27-
it('does not set invalid point when coordinates are wrong', async () => {
27+
it('should not set invalid point when coordinates are wrong', async () => {
2828
const scenario = await Scenario.init(
2929
'Invalid coords',
3030
html(
@@ -43,7 +43,7 @@ describe('odk:setgeopoint action', () => {
4343
expect(scenario.answerOf('/data/destination').getValue()).toBe('');
4444
});
4545

46-
it('does not set invalid point when incorrect text provided', async () => {
46+
it('should not set invalid point when incorrect text provided', async () => {
4747
const scenario = await Scenario.init(
4848
'Invalid text',
4949
html(
@@ -62,6 +62,25 @@ describe('odk:setgeopoint action', () => {
6262
expect(scenario.answerOf('/data/destination').getValue()).toBe('');
6363
});
6464

65+
it('should not set point when incorrect event provided', async () => {
66+
const scenario = await Scenario.init(
67+
'Invalid event',
68+
html(
69+
head(
70+
title('Invalid event'),
71+
model(
72+
mainInstance(t('data id="invalid-event"', t('source'), t('destination'))),
73+
bind('/data/destination').type('string')
74+
)
75+
),
76+
body(input('/data/source'), setgeopoint('odk-some-random-event', '/data/destination'))
77+
),
78+
geolocationProvider
79+
);
80+
81+
expect(scenario.answerOf('/data/destination').getValue()).toBe('');
82+
});
83+
6584
it('set point when event is odk-instance-first-load', async () => {
6685
const scenario = await Scenario.init(
6786
'On first load',

0 commit comments

Comments
 (0)