Skip to content

Commit 5d2e87a

Browse files
authored
test(slock): cover trimmed task status filters (#2041)
1 parent b3695a2 commit 5d2e87a

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

clis/slock/task-list-server.test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,11 @@ describe('slock task-list-server', () => {
2828

2929
it('passes ?status= through when --status is set', async () => {
3030
const page = makePage({ kind: 'ok', rows: [] });
31-
await command.func(page, { status: 'todo' });
31+
await command.func(page, { status: ' todo ' });
3232
const snippet = page.evaluate.mock.calls[0][0];
3333
expect(snippet).toContain('?status=');
3434
expect(snippet).toContain('"todo"');
35+
expect(snippet).not.toContain('" todo "');
3536
});
3637

3738
it('rejects an invalid --status before navigation', async () => {

clis/slock/task-list.test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,11 @@ describe('slock task-list', () => {
2424

2525
it('passes ?status=<value> through when --status is set (server-side filter)', async () => {
2626
const page = makePage({ kind: 'ok', rows: [] });
27-
await command.func(page, { channel: '11111111-1111-1111-1111-111111111111', status: 'in_review' });
27+
await command.func(page, { channel: '11111111-1111-1111-1111-111111111111', status: ' in_review ' });
2828
const snippet = page.evaluate.mock.calls[0][0];
2929
expect(snippet).toContain('?status=');
3030
expect(snippet).toContain('"in_review"');
31+
expect(snippet).not.toContain('" in_review "');
3132
});
3233

3334
it('rejects an invalid --status before navigation', async () => {

0 commit comments

Comments
 (0)