4794-mdb_block #1170
|
@ -0,0 +1,22 @@
|
|||
const models = require('vn-loopback/server/server').models;
|
||||
|
||||
describe('MdbApp lock()', () => {
|
||||
it(`should lock a mdb `, async() => {
|
||||
const tx = await models.MdbApp.beginTransaction({});
|
||||
|
||||
try {
|
||||
const options = {transaction: tx};
|
||||
const appName = 'com';
|
||||
vicent marked this conversation as resolved
Outdated
|
||||
const developerId = 9;
|
||||
const ctx = {req: {accessToken: {userId: developerId}}};
|
||||
|
||||
const result = await models.MdbApp.lock(ctx, appName, options);
|
||||
|
||||
expect(result.locked).not.toBeNull();
|
||||
|
||||
await tx.rollback();
|
||||
} catch (e) {
|
||||
await tx.rollback();
|
||||
}
|
||||
});
|
||||
});
|
|
@ -0,0 +1,22 @@
|
|||
const models = require('vn-loopback/server/server').models;
|
||||
|
||||
describe('MdbApp unlock()', () => {
|
||||
it(`should unlock a mdb `, async() => {
|
||||
const tx = await models.MdbApp.beginTransaction({});
|
||||
|
||||
try {
|
||||
const options = {transaction: tx};
|
||||
const appName = 'com';
|
||||
const developerId = 9;
|
||||
const ctx = {req: {accessToken: {userId: developerId}}};
|
||||
|
||||
const result = await models.MdbApp.unlock(ctx, appName, options);
|
||||
|
||||
expect(result.locked).toBeNull();
|
||||
|
||||
await tx.rollback();
|
||||
} catch (e) {
|
||||
await tx.rollback();
|
||||
}
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue
foo