refs #6264 test: remove force describe for dms test
This commit is contained in:
parent
d0af29c0c5
commit
1939c65fab
|
@ -1,6 +1,5 @@
|
|||
const app = require('vn-loopback/server/server');
|
||||
|
||||
// f
|
||||
describe('TicketDms removeFile()', () => {
|
||||
const ticketDmsId = 1;
|
||||
it(`should return an error for a user without enough privileges`, async() => {
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
const models = require('vn-loopback/server/server').models;
|
||||
|
||||
// f
|
||||
describe('ClientDms removeFile()', () => {
|
||||
it(`should return an error for a user without enough privileges`, async() => {
|
||||
const tx = await models.Client.beginTransaction({});
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
const models = require('vn-loopback/server/server').models;
|
||||
// f
|
||||
|
||||
describe('Ticket uploadFile()', () => {
|
||||
it(`should return an error for a user without enough privileges`, async() => {
|
||||
const tx = await models.Ticket.beginTransaction({});
|
||||
|
@ -23,27 +23,4 @@ describe('Ticket uploadFile()', () => {
|
|||
|
||||
expect(error.message).toEqual(`You don't have enough privileges`);
|
||||
});
|
||||
|
||||
// fit(`should uploadFile`, async() => {
|
||||
// const tx = await models.Ticket.beginTransaction({});
|
||||
|
||||
// let error;
|
||||
// try {
|
||||
// const options = {transaction: tx};
|
||||
|
||||
// const ticketId = 15;
|
||||
// const currentUserId = 9;
|
||||
// const ticketTypeId = 14;
|
||||
// const ctx = {req: {accessToken: {userId: currentUserId}}, args: {dmsTypeId: ticketTypeId}, result: new ArrayBuffer(20000)};
|
||||
|
||||
// await models.Ticket.uploadFile(ctx, ticketId, options);
|
||||
|
||||
// await tx.rollback();
|
||||
// } catch (e) {
|
||||
// await tx.rollback();
|
||||
// error = e;
|
||||
// }
|
||||
|
||||
// expect(error.message).toEqual(`You don't have enough privileges`);
|
||||
// });
|
||||
});
|
||||
|
|
|
@ -61,6 +61,7 @@ module.exports = Self => {
|
|||
|
||||
try {
|
||||
const uploadedFiles = await Dms.uploadFile(ctx, myOptions);
|
||||
|
||||
const promises = uploadedFiles.map(dms => TicketDms.create({
|
||||
ticketFk: id,
|
||||
dmsFk: dms.id
|
||||
|
|
|
@ -30,14 +30,10 @@ module.exports = Self => {
|
|||
}
|
||||
|
||||
try {
|
||||
// const dms = await Self.app.models.Dms.findById(id, null, myOptions);
|
||||
const WorkerDms = await Self.findOne({
|
||||
where: {document: id}
|
||||
}, myOptions);
|
||||
|
||||
// const targetDms = await Self.app.models.Dms.removeFile(ctx, id, myOptions);
|
||||
// const WorkerDms = await Self.findById(+targetDms.reference, null, myOptions);
|
||||
|
||||
const targetDms = await Self.app.models.Dms.removeFile(ctx, id, myOptions);
|
||||
|
||||
if (!targetDms || !WorkerDms)
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
const app = require('vn-loopback/server/server');
|
||||
|
||||
// f
|
||||
describe('WorkerDms removeFile()', () => {
|
||||
const workerDmsFk = 1;
|
||||
it(`should return an error for a user without enough privileges`, async() => {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
const app = require('vn-loopback/server/server');
|
||||
// f
|
||||
|
||||
describe('Worker uploadFile()', () => {
|
||||
it(`should return an error for a user without enough privileges`, async() => {
|
||||
let workerId = 1106;
|
||||
|
|
Loading…
Reference in New Issue