7199-devToTest_2316 #2287

Merged
alexm merged 169 commits from 7199-devToTest_2316 into test 2024-04-11 06:25:23 +00:00
1 changed files with 35 additions and 0 deletions
Showing only changes of commit 449a06c85c - Show all commits

View File

@ -0,0 +1,35 @@
const models = require('vn-loopback/server/server').models;
describe('Application getEnumValues()', () => {
let tx;
beforeEach(async() => {
tx = await models.Application.beginTransaction({});
const options = {transaction: tx};
await models.Application.rawSql(`
CREATE TABLE tableWithEnum (
direction enum('in', 'out', 'middle'),
PRIMARY KEY (direction)
) ENGINE=InnoDB;
`, null, options);
});
it('should return three if is ok', async() => {
try {
const options = {transaction: tx};
const response = await models.Application.getEnumValues(
'vn',
'tableWithEnum',
'direction',
options
);
expect(response.length).toEqual(3);
await tx.rollback();
} catch (e) {
await tx.rollback();
throw e;
}
});
});