refactor: delete unnecessary test
gitea/salix/pipeline/head This commit is unstable Details

This commit is contained in:
Alex Moreno 2022-11-10 14:38:37 +01:00
parent 8d731946f6
commit 37d412bf3b
4 changed files with 1 additions and 22 deletions

View File

@ -1,7 +1,7 @@
import selectors from '../../helpers/selectors.js';
import getBrowser from '../../helpers/puppeteer';
describe('Ticket expeditions and log path', () => {
fdescribe('Ticket expeditions and log path', () => {
let browser;
let page;

View File

@ -9,24 +9,6 @@ describe('sale updateQuantity()', () => {
}
};
it('should throw an error if the quantity is not a number', async() => {
const tx = await models.Sale.beginTransaction({});
let error;
try {
const options = {transaction: tx};
await models.Sale.updateQuantity(ctx, 1, 'wrong quantity!', options);
await tx.rollback();
} catch (e) {
await tx.rollback();
error = e;
}
expect(error).toEqual(new Error('The value should be a number'));
});
it('should throw an error if the quantity is greater than it should be', async() => {
const ctx = {
req: {

View File

@ -41,9 +41,6 @@ module.exports = Self => {
}
try {
if (isNaN(newQuantity))
throw new UserError(`The value should be a number`);
const canEditSale = await models.Sale.canEdit(ctx, [id], myOptions);
if (!canEditSale)
throw new UserError(`Sale(s) blocked, please contact production`);