tet: adapt frontend tests

This commit is contained in:
Sami Mazouz 2024-03-08 21:24:05 +01:00
parent 1fe426aba9
commit f3b819009b
No known key found for this signature in database
2 changed files with 19 additions and 5 deletions

View File

@ -7,7 +7,7 @@ test('gambits are converted to filters', function () {
q: 'lorem', q: 'lorem',
created: '2023-07-07', created: '2023-07-07',
hidden: true, hidden: true,
author: ['behz'], author: 'behz',
}); });
}); });
@ -16,7 +16,7 @@ test('gambits are negated when prefixed with a dash', function () {
q: 'lorem', q: 'lorem',
'-created': '2023-07-07', '-created': '2023-07-07',
'-hidden': true, '-hidden': true,
'-author': ['behz'], '-author': 'behz',
}); });
}); });
@ -29,6 +29,6 @@ test('gambits are only applied for the correct resource type', function () {
q: 'lorem email:behz@machine.local', q: 'lorem email:behz@machine.local',
created: '2023-07-07..2023-10-18', created: '2023-07-07..2023-10-18',
hidden: true, hidden: true,
'-author': ['behz'], '-author': 'behz',
}); });
}); });

View File

@ -19,11 +19,25 @@ function bootApp() {
{ {
type: 'forums', type: 'forums',
id: '1', id: '1',
attributes: {}, attributes: {
canEditUserCredentials: true,
},
},
{
type: 'users',
id: '1',
attributes: {
id: 1,
username: 'admin',
displayName: 'Admin',
email: 'admin@machine.local',
joinTime: '2021-01-01T00:00:00Z',
isEmailConfirmed: true,
},
}, },
], ],
session: { session: {
userId: 0, userId: 1,
csrfToken: 'test', csrfToken: 'test',
}, },
}); });