chore: fixing these tests too

Signed-off-by: blam <ben@blam.sh>
This commit is contained in:
blam
2022-05-13 11:14:03 +02:00
parent 2de8c51462
commit 4ee9ef6d36
2 changed files with 14 additions and 20 deletions
@@ -221,9 +221,8 @@ describe('StorageTaskBroker', () => {
it('should list only tasks createdBy a specific user', async () => {
const broker = new StorageTaskBroker(storage, logger);
const { taskId } = await broker.dispatch({
spec: {
user: { ref: 'user:default/foo', entity: {} as UserEntity },
} as TaskSpec,
spec: {} as TaskSpec,
createdBy: 'user:default/foo',
});
const task = await storage.getTask(taskId);
@@ -217,23 +217,18 @@ describe('createRouter', () => {
const mockToken =
'blob.eyJzdWIiOiJ1c2VyOmRlZmF1bHQvZ3Vlc3QiLCJuYW1lIjoiSm9obiBEb2UifQ.blob';
console.log(
JSON.stringify(
await request(app)
.post('/v2/tasks')
.set('Authorization', `Bearer ${mockToken}`)
.send({
templateRef: stringifyEntityRef({
kind: 'template',
name: 'create-react-app-template',
}),
values: {
required: 'required-value',
},
}),
),
);
await request(app)
.post('/v2/tasks')
.set('Authorization', `Bearer ${mockToken}`)
.send({
templateRef: stringifyEntityRef({
kind: 'template',
name: 'create-react-app-template',
}),
values: {
required: 'required-value',
},
});
expect(broker).toHaveBeenCalledWith(
expect.objectContaining({
createdBy: 'user:default/guest',