parent
3be27c262f
commit
f7f58bfe99
@ -85,6 +85,7 @@ describe('add action', () => {
|
||||
values: [t1.get('id'), t2.get('id')],
|
||||
});
|
||||
|
||||
expect(response.status).toEqual(200);
|
||||
expect(await p1.countTags()).toEqual(2);
|
||||
|
||||
// add with through values
|
||||
|
@ -74,6 +74,7 @@ describe('destroy action', () => {
|
||||
filterByTk: p1.get('id'),
|
||||
});
|
||||
|
||||
expect(response.statusCode).toEqual(200);
|
||||
expect(await Post.repository.count()).toEqual(0);
|
||||
});
|
||||
|
||||
@ -142,10 +143,7 @@ describe('destroy action', () => {
|
||||
|
||||
const postProfile = await Profile.repository.findOne();
|
||||
|
||||
const response = await app
|
||||
.agent()
|
||||
.resource('posts.profile', p1.get('id'))
|
||||
.destroy();
|
||||
const response = await app.agent().resource('posts.profile', p1.get('id')).destroy();
|
||||
|
||||
expect(await Profile.repository.count()).toEqual(0);
|
||||
});
|
||||
|
@ -85,6 +85,8 @@ describe('set action', () => {
|
||||
values: [t1.get('id'), t2.get('id')],
|
||||
});
|
||||
|
||||
expect(response.statusCode).toEqual(200);
|
||||
|
||||
expect(await p1.countTags()).toEqual(2);
|
||||
|
||||
// add with through values
|
||||
|
@ -84,6 +84,7 @@ describe('toggle action', () => {
|
||||
.toggle({
|
||||
values: [t1.get('id'), t2.get('id')],
|
||||
});
|
||||
expect(response.statusCode).toEqual(200);
|
||||
|
||||
expect(await p1.countTags()).toEqual(2);
|
||||
|
||||
|
@ -104,6 +104,7 @@ describe('update action', () => {
|
||||
content: 'c0',
|
||||
},
|
||||
});
|
||||
expect(response.statusCode).toEqual(200);
|
||||
|
||||
await c1.reload();
|
||||
expect(c1.get('content')).toEqual('c0');
|
||||
|
@ -10,5 +10,8 @@ export async function add(ctx: Context, next) {
|
||||
}
|
||||
|
||||
await (<HasManyRepository | BelongsToManyRepository>repository).add(ctx.action.params.values);
|
||||
|
||||
ctx.status = 200;
|
||||
|
||||
await next();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user