Requested changes + e2e updated
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
be37334f49
commit
4c7d95f001
|
@ -41,6 +41,6 @@ describe('Entry lastest buys path', () => {
|
|||
|
||||
it('should navigate to the entry.buy section by clicking one of the buys', async() => {
|
||||
await page.waitToClick(selectors.entryLatestBuys.firstBuy);
|
||||
await page.waitForState('entry.card.buy');
|
||||
await page.waitForState('entry.card.buy.index');
|
||||
});
|
||||
});
|
||||
|
|
|
@ -20,11 +20,13 @@ describe('entry import()', () => {
|
|||
});
|
||||
|
||||
it('should import the buy rows', async() => {
|
||||
const expectedRef = '1, 2';
|
||||
const expectedObservation = '123456';
|
||||
const ctx = {
|
||||
req: activeCtx,
|
||||
args: {
|
||||
observation: '123456',
|
||||
ref: '1, 2',
|
||||
observation: expectedObservation,
|
||||
ref: expectedRef,
|
||||
buys: [
|
||||
{
|
||||
itemFk: 1,
|
||||
|
@ -33,7 +35,8 @@ describe('entry import()', () => {
|
|||
grouping: 1,
|
||||
packing: 1,
|
||||
size: 1,
|
||||
volume: 1200
|
||||
volume: 1200,
|
||||
packageFk: '94'
|
||||
},
|
||||
{
|
||||
itemFk: 4,
|
||||
|
@ -42,7 +45,8 @@ describe('entry import()', () => {
|
|||
grouping: 1,
|
||||
packing: 1,
|
||||
size: 25,
|
||||
volume: 1125
|
||||
volume: 1125,
|
||||
packageFk: '94'
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -66,8 +70,8 @@ describe('entry import()', () => {
|
|||
where: {entryFk: newEntry.id}
|
||||
}, options);
|
||||
|
||||
expect(updatedEntry.observation).toEqual('123456');
|
||||
expect(updatedEntry.ref).toEqual('1, 2');
|
||||
expect(updatedEntry.observation).toEqual(expectedObservation);
|
||||
expect(updatedEntry.ref).toEqual(expectedRef);
|
||||
expect(entryBuys.length).toEqual(2);
|
||||
|
||||
// Restores
|
||||
|
|
|
@ -12,6 +12,7 @@ describe('entry importBuysPreview()', () => {
|
|||
});
|
||||
|
||||
it('should return the buys with the calculated packageFk', async() => {
|
||||
const expectedPackageFk = '3';
|
||||
const buys = [
|
||||
{
|
||||
itemFk: 1,
|
||||
|
@ -35,6 +36,6 @@ describe('entry importBuysPreview()', () => {
|
|||
const randomIndex = Math.floor(Math.random() * result.length);
|
||||
const buy = result[randomIndex];
|
||||
|
||||
expect(buy.packageFk).toEqual('3');
|
||||
expect(buy.packageFk).toEqual(expectedPackageFk);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -97,6 +97,23 @@ describe('Entry', () => {
|
|||
});
|
||||
|
||||
describe('onSubmit()', () => {
|
||||
it(`should throw an error when some of the rows doesn't have an item`, () => {
|
||||
jest.spyOn(controller.vnApp, 'showError');
|
||||
|
||||
controller.import = {
|
||||
observation: '123456',
|
||||
ref: '1, 2',
|
||||
buys: [
|
||||
{'buyingValue': 5.77, 'description': 'Bow', 'grouping': 1, 'packing': 1, 'size': 1, 'volume': 1200},
|
||||
{'buyingValue': 2.16, 'description': 'Arrow', 'grouping': 1, 'packing': 1, 'size': 25, 'volume': 1125}
|
||||
]
|
||||
};
|
||||
|
||||
controller.onSubmit();
|
||||
|
||||
expect(controller.vnApp.showError).toHaveBeenCalledWith(`Some of the imported buys doesn't have an item`);
|
||||
});
|
||||
|
||||
it(`should perform a query to update columns`, () => {
|
||||
jest.spyOn(controller.vnApp, 'showSuccess');
|
||||
controller.$state.go = jest.fn();
|
||||
|
@ -105,8 +122,8 @@ describe('Entry', () => {
|
|||
observation: '123456',
|
||||
ref: '1, 2',
|
||||
buys: [
|
||||
{'buyingValue': 5.77, 'description': 'Bow', 'grouping': 1, 'packing': 1, 'size': 1, 'volume': 1200},
|
||||
{'buyingValue': 2.16, 'description': 'Arrow', 'grouping': 1, 'packing': 1, 'size': 25, 'volume': 1125}
|
||||
{'itemFk': 10, 'buyingValue': 5.77, 'description': 'Bow', 'grouping': 1, 'packing': 1, 'size': 1, 'volume': 1200},
|
||||
{'itemFk': 11, 'buyingValue': 2.16, 'description': 'Arrow', 'grouping': 1, 'packing': 1, 'size': 25, 'volume': 1125}
|
||||
]
|
||||
};
|
||||
const params = controller.import;
|
||||
|
|
|
@ -61,7 +61,7 @@
|
|||
<vn-tbody>
|
||||
<a ng-repeat="buy in $ctrl.buys"
|
||||
class="clickable vn-tr search-result"
|
||||
ui-sref="entry.card.buy({id: {{::buy.entryFk}}})">
|
||||
ui-sref="entry.card.buy.index({id: {{::buy.entryFk}}})">
|
||||
<vn-td shrink>
|
||||
<vn-check
|
||||
ng-model="buy.checked"
|
||||
|
|
Loading…
Reference in New Issue