HOTFIX refs #5929 fix(isEditable): can edit if is weekly #1770
|
@ -520,8 +520,7 @@ export default {
|
||||||
searchResultDate: 'vn-ticket-summary [label=Landed] span',
|
searchResultDate: 'vn-ticket-summary [label=Landed] span',
|
||||||
topbarSearch: 'vn-searchbar',
|
topbarSearch: 'vn-searchbar',
|
||||||
moreMenu: 'vn-ticket-index vn-icon-button[icon=more_vert]',
|
moreMenu: 'vn-ticket-index vn-icon-button[icon=more_vert]',
|
||||||
fourthWeeklyTicket: 'vn-ticket-weekly-index vn-card smart-table slot-table tr:nth-child(5)',
|
thirdWeeklyTicket: 'vn-ticket-weekly-index vn-card smart-table slot-table tr:nth-child(4)',
|
||||||
fiveWeeklyTicket: 'vn-ticket-weekly-index vn-card smart-table slot-table tr:nth-child(6)',
|
|
||||||
weeklyTicket: 'vn-ticket-weekly-index vn-card smart-table slot-table table tbody tr',
|
weeklyTicket: 'vn-ticket-weekly-index vn-card smart-table slot-table table tbody tr',
|
||||||
firstWeeklyTicketDeleteIcon: 'vn-ticket-weekly-index vn-card smart-table slot-table tr:nth-child(2) vn-icon-button[icon="delete"]',
|
firstWeeklyTicketDeleteIcon: 'vn-ticket-weekly-index vn-card smart-table slot-table tr:nth-child(2) vn-icon-button[icon="delete"]',
|
||||||
firstWeeklyTicketAgency: 'vn-ticket-weekly-index vn-card smart-table slot-table tr:nth-child(2) [ng-model="weekly.agencyModeFk"]',
|
firstWeeklyTicketAgency: 'vn-ticket-weekly-index vn-card smart-table slot-table tr:nth-child(2) [ng-model="weekly.agencyModeFk"]',
|
||||||
|
|
|
@ -19,7 +19,7 @@ describe('Ticket descriptor path', () => {
|
||||||
it('should count the amount of tickets in the turns section', async() => {
|
it('should count the amount of tickets in the turns section', async() => {
|
||||||
const result = await page.countElement(selectors.ticketsIndex.weeklyTicket);
|
const result = await page.countElement(selectors.ticketsIndex.weeklyTicket);
|
||||||
|
|
||||||
expect(result).toEqual(7);
|
expect(result).toEqual(5);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should go back to the ticket index then search and access a ticket summary', async() => {
|
it('should go back to the ticket index then search and access a ticket summary', async() => {
|
||||||
|
@ -45,7 +45,7 @@ describe('Ticket descriptor path', () => {
|
||||||
|
|
||||||
it('should confirm the ticket 11 was added to thursday', async() => {
|
it('should confirm the ticket 11 was added to thursday', async() => {
|
||||||
await page.accessToSection('ticket.weekly.index');
|
await page.accessToSection('ticket.weekly.index');
|
||||||
const result = await page.waitToGetProperty(selectors.ticketsIndex.fourthWeeklyTicket, 'value');
|
const result = await page.waitToGetProperty(selectors.ticketsIndex.thirdWeeklyTicket, 'value');
|
||||||
|
|
||||||
expect(result).toEqual('Thursday');
|
expect(result).toEqual('Thursday');
|
||||||
});
|
});
|
||||||
|
@ -80,7 +80,9 @@ describe('Ticket descriptor path', () => {
|
||||||
|
|
||||||
it('should confirm the ticket 11 was added on saturday', async() => {
|
it('should confirm the ticket 11 was added on saturday', async() => {
|
||||||
await page.accessToSection('ticket.weekly.index');
|
await page.accessToSection('ticket.weekly.index');
|
||||||
const result = await page.waitToGetProperty(selectors.ticketsIndex.fiveWeeklyTicket, 'value');
|
await page.waitForTimeout(5000);
|
||||||
|
|
||||||
|
const result = await page.waitToGetProperty(selectors.ticketsIndex.thirdWeeklyTicket, 'value');
|
||||||
|
|
||||||
expect(result).toEqual('Saturday');
|
expect(result).toEqual('Saturday');
|
||||||
});
|
});
|
||||||
|
@ -104,7 +106,7 @@ describe('Ticket descriptor path', () => {
|
||||||
await page.doSearch();
|
await page.doSearch();
|
||||||
const nResults = await page.countElement(selectors.ticketsIndex.searchWeeklyResult);
|
const nResults = await page.countElement(selectors.ticketsIndex.searchWeeklyResult);
|
||||||
|
|
||||||
expect(nResults).toEqual(7);
|
expect(nResults).toEqual(5);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should update the agency then remove it afterwards', async() => {
|
it('should update the agency then remove it afterwards', async() => {
|
||||||
|
|
|
@ -14,7 +14,7 @@ describe('ticket-request filter()', () => {
|
||||||
|
|
||||||
const result = await models.TicketRequest.filter(ctx, options);
|
const result = await models.TicketRequest.filter(ctx, options);
|
||||||
|
|
||||||
expect(result.length).toEqual(3);
|
expect(result.length).toEqual(5);
|
||||||
|
|
||||||
await tx.rollback();
|
await tx.rollback();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@ -93,7 +93,7 @@ describe('ticket-request filter()', () => {
|
||||||
const result = await models.TicketRequest.filter(ctx, options);
|
const result = await models.TicketRequest.filter(ctx, options);
|
||||||
const requestId = result[0].id;
|
const requestId = result[0].id;
|
||||||
|
|
||||||
expect(requestId).toEqual(3);
|
expect(requestId).toEqual(1);
|
||||||
|
|
||||||
await tx.rollback();
|
await tx.rollback();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@ -113,7 +113,7 @@ describe('ticket-request filter()', () => {
|
||||||
const result = await models.TicketRequest.filter(ctx, options);
|
const result = await models.TicketRequest.filter(ctx, options);
|
||||||
const requestId = result[0].id;
|
const requestId = result[0].id;
|
||||||
|
|
||||||
expect(requestId).toEqual(3);
|
expect(requestId).toEqual(1);
|
||||||
|
|
||||||
await tx.rollback();
|
await tx.rollback();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@ -153,7 +153,7 @@ describe('ticket-request filter()', () => {
|
||||||
const result = await models.TicketRequest.filter(ctx, {order: 'id'}, options);
|
const result = await models.TicketRequest.filter(ctx, {order: 'id'}, options);
|
||||||
const requestId = result[0].id;
|
const requestId = result[0].id;
|
||||||
|
|
||||||
expect(requestId).toEqual(3);
|
expect(requestId).toEqual(1);
|
||||||
|
|
||||||
await tx.rollback();
|
await tx.rollback();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@ -173,7 +173,7 @@ describe('ticket-request filter()', () => {
|
||||||
const result = await models.TicketRequest.filter(ctx, options);
|
const result = await models.TicketRequest.filter(ctx, options);
|
||||||
const requestId = result[0].id;
|
const requestId = result[0].id;
|
||||||
|
|
||||||
expect(requestId).toEqual(3);
|
expect(requestId).toEqual(1);
|
||||||
|
|
||||||
await tx.rollback();
|
await tx.rollback();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
|
@ -16,8 +16,8 @@ describe('ticket-weekly filter()', () => {
|
||||||
|
|
||||||
const firstRow = result[0];
|
const firstRow = result[0];
|
||||||
|
|
||||||
expect(firstRow.ticketFk).toEqual(1);
|
expect(firstRow.ticketFk).toEqual(2);
|
||||||
expect(result.length).toEqual(6);
|
expect(result.length).toEqual(4);
|
||||||
|
|
||||||
await tx.rollback();
|
await tx.rollback();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@ -52,12 +52,12 @@ describe('ticket-weekly filter()', () => {
|
||||||
try {
|
try {
|
||||||
const options = {transaction: tx};
|
const options = {transaction: tx};
|
||||||
|
|
||||||
const ctx = {req: {accessToken: {userId: authUserId}}, args: {search: 'bruce'}};
|
const ctx = {req: {accessToken: {userId: authUserId}}, args: {search: 'max'}};
|
||||||
|
|
||||||
const result = await models.TicketWeekly.filter(ctx, null, options);
|
const result = await models.TicketWeekly.filter(ctx, null, options);
|
||||||
const firstRow = result[0];
|
const firstRow = result[0];
|
||||||
|
|
||||||
expect(firstRow.clientName).toEqual('Bruce Wayne');
|
expect(firstRow.clientName).toEqual('Max Eisenhardt');
|
||||||
|
|
||||||
await tx.rollback();
|
await tx.rollback();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@ -72,13 +72,13 @@ describe('ticket-weekly filter()', () => {
|
||||||
try {
|
try {
|
||||||
const options = {transaction: tx};
|
const options = {transaction: tx};
|
||||||
|
|
||||||
const ctx = {req: {accessToken: {userId: authUserId}}, args: {search: 1101}};
|
const ctx = {req: {accessToken: {userId: authUserId}}, args: {search: 1105}};
|
||||||
|
|
||||||
const result = await models.TicketWeekly.filter(ctx, null, options);
|
const result = await models.TicketWeekly.filter(ctx, null, options);
|
||||||
const firstRow = result[0];
|
const firstRow = result[0];
|
||||||
|
|
||||||
expect(firstRow.clientFk).toEqual(1101);
|
expect(firstRow.clientFk).toEqual(1105);
|
||||||
expect(firstRow.clientName).toEqual('Bruce Wayne');
|
expect(firstRow.clientName).toEqual('Max Eisenhardt');
|
||||||
|
|
||||||
await tx.rollback();
|
await tx.rollback();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
|
@ -8,7 +8,7 @@ describe('isEditable()', () => {
|
||||||
try {
|
try {
|
||||||
const options = {transaction: tx};
|
const options = {transaction: tx};
|
||||||
const ctx = {req: {accessToken: {userId: 35}}};
|
const ctx = {req: {accessToken: {userId: 35}}};
|
||||||
result = await models.Ticket.isEditable(ctx, 5, options);
|
result = await models.Ticket.isEditable(ctx, 19, options);
|
||||||
await tx.rollback();
|
await tx.rollback();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
await tx.rollback();
|
await tx.rollback();
|
||||||
|
|
Loading…
Reference in New Issue