Skip to content

Commit 647b3d2

Browse files
committed
test shorthand notation
1 parent a4e6152 commit 647b3d2

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

src/__tests__/OfflineQuery-test.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@ describe('OfflineQuery', () => {
8080
q.lessThan('ttl', { $relativeTime: '5 days ago' });
8181
expect(matchesQuery(q.className, obj, [], q)).toBe(false);
8282

83+
q = new ParseQuery('Item');
84+
q.lessThan('ttl', { $relativeTime: '0 yr 0 wk 5 d 0 hr 0 min 0 sec ago' });
85+
expect(matchesQuery(q.className, obj, [], q)).toBe(false);
86+
8387
q = new ParseQuery('Item');
8488
q.greaterThan('ttl', { $relativeTime: 'now' });
8589
expect(matchesQuery(q.className, obj, [], q)).toBe(true);
@@ -90,7 +94,19 @@ describe('OfflineQuery', () => {
9094
expect(matchesQuery(q.className, obj, [], q)).toBe(true);
9195

9296
q = new ParseQuery('Item');
93-
q.greaterThan('ttl', { $relativeTime: '1 year 3 weeks 1 hour 3 minutes 2 seconds ago' });
97+
q.greaterThan('ttl', { $relativeTime: '1 years 3 weeks 1 hours 3 minutes 2 seconds ago' });
98+
expect(matchesQuery(q.className, obj, [], q)).toBe(true);
99+
100+
q = new ParseQuery('Item');
101+
q.greaterThan('ttl', { $relativeTime: '2 year 2 week 1 hour 4 day 3 minute 2 second ago' });
102+
expect(matchesQuery(q.className, obj, [], q)).toBe(true);
103+
104+
q = new ParseQuery('Item');
105+
q.greaterThan('ttl', { $relativeTime: '2 yrs 2 wks 1 hrs 3 mins 2 secs ago' });
106+
expect(matchesQuery(q.className, obj, [], q)).toBe(true);
107+
108+
q = new ParseQuery('Item');
109+
q.greaterThan('ttl', { $relativeTime: '0 yr 0 wk 0 d 24 hr 3 min 2 sec ago' });
94110
expect(matchesQuery(q.className, obj, [], q)).toBe(true);
95111
});
96112

0 commit comments

Comments
 (0)