test_to_dev #1513

Merged
alexm merged 12 commits from test_to_dev into dev 2023-05-10 10:41:12 +00:00
10 changed files with 26 additions and 45 deletions
Showing only changes of commit 2aaded4ed4 - Show all commits

View File

@ -29,19 +29,16 @@ describe('Client Add greuge path', () => {
expect(message.text).toContain('Some fields are invalid'); expect(message.text).toContain('Some fields are invalid');
}); });
it(`should create a new greuge with all its data`, async() => { it(`should create a new greuge with all its data and confirm the greuge was added to the list`, async() => {
await page.write(selectors.clientGreuge.amount, '999'); await page.write(selectors.clientGreuge.amount, '999');
await page.waitForTextInField(selectors.clientGreuge.amount, '999'); await page.waitForTextInField(selectors.clientGreuge.amount, '999');
await page.write(selectors.clientGreuge.description, 'new armor for Batman!'); await page.write(selectors.clientGreuge.description, 'new armor for Batman!');
await page.waitToClick(selectors.clientGreuge.saveButton); await page.waitToClick(selectors.clientGreuge.saveButton);
const message = await page.waitForSnackbar(); const message = await page.waitForSnackbar();
expect(message.text).toContain('Data saved!');
});
it('should confirm the greuge was added to the list', async() => {
const result = await page.waitToGetProperty(selectors.clientGreuge.firstGreugeText, 'innerText'); const result = await page.waitToGetProperty(selectors.clientGreuge.firstGreugeText, 'innerText');
expect(message.text).toContain('Data saved!');
expect(result).toContain(999); expect(result).toContain(999);
expect(result).toContain('new armor for Batman!'); expect(result).toContain('new armor for Batman!');
expect(result).toContain('Diff'); expect(result).toContain('Diff');

View File

@ -236,7 +236,7 @@ export default class CrudModel extends ModelProxy {
this.canceler = this.$q.defer(); this.canceler = this.$q.defer();
this.isPaging = append; this.isPaging = append;
if (!append && this.status != 'ready') if (!append)
this.status = 'loading'; this.status = 'loading';
let params = Object.assign( let params = Object.assign(

View File

@ -8,18 +8,8 @@ export default class Th {
$element.on('click', () => this.onToggleOrder()); $element.on('click', () => this.onToggleOrder());
} }
/**
* Changes the order if the cell has a field and defaultOrder property
*/
$onInit() { $onInit() {
if (!this.field) return; if (!this.field) return;
if (this.defaultOrder) {
this.order = this.defaultOrder;
this.table.applyOrder(this.field, this.order);
this.updateArrow();
}
this.updateArrow(); this.updateArrow();
} }
@ -82,9 +72,6 @@ ngModule.vnComponent('vnTh', {
template: require('./index.html'), template: require('./index.html'),
transclude: true, transclude: true,
controller: Th, controller: Th,
bindings: {
defaultOrder: '@?'
},
require: { require: {
table: '^^vnTable' table: '^^vnTable'
} }

View File

@ -14,10 +14,7 @@
order="changedModel" order="changedModel"
auto-load="true"> auto-load="true">
</vn-crud-model> </vn-crud-model>
<vn-data-viewer <vn-data-viewer model="model" class="vn-w-md vn-px-sm">
model="model"
is-loading="model.isLoading"
class="vn-w-md vn-px-sm">
<div class="change vn-mb-sm" ng-repeat="log in $ctrl.logs"> <div class="change vn-mb-sm" ng-repeat="log in $ctrl.logs">
<div class="user-wrapper"> <div class="user-wrapper">
<vn-avatar class="vn-mt-xs" <vn-avatar class="vn-mt-xs"

View File

@ -7,8 +7,8 @@
data="greuges" data="greuges"
auto-load="true"> auto-load="true">
</vn-crud-model> </vn-crud-model>
<mg-ajax <mg-ajax
path="greuges/{{$ctrl.$params.id}}/sumAmount" path="greuges/{{$ctrl.$params.id}}/sumAmount"
options="mgEdit"> options="mgEdit">
</mg-ajax> </mg-ajax>
<vn-data-viewer <vn-data-viewer
@ -19,7 +19,7 @@
style="text-align: right;" style="text-align: right;"
class="vn-mb-md vn-pa-lg"> class="vn-mb-md vn-pa-lg">
<vn-label-value <vn-label-value
label="Total" label="Total"
value="{{edit.model.sumAmount | currency: 'EUR': 2}}"> value="{{edit.model.sumAmount | currency: 'EUR': 2}}">
</vn-label-value> </vn-label-value>
</vn-card> </vn-card>
@ -28,7 +28,7 @@
<vn-table model="model" auto-load="false"> <vn-table model="model" auto-load="false">
<vn-thead> <vn-thead>
<vn-tr> <vn-tr>
<vn-th field="shipped" default-order="DESC" expand>Date</vn-th> <vn-th field="shipped" expand>Date</vn-th>
<vn-th field="userFk">Created by</vn-thfield></vn-th> <vn-th field="userFk">Created by</vn-thfield></vn-th>
<vn-th field="description">Comment</vn-th> <vn-th field="description">Comment</vn-th>
<vn-th field="greugeTypeFk">Type</vn-th> <vn-th field="greugeTypeFk">Type</vn-th>
@ -53,11 +53,11 @@
</vn-data-viewer> </vn-data-viewer>
<vn-float-button <vn-float-button
icon="add" icon="add"
ui-sref="client.card.greuge.create" ui-sref="client.card.greuge.create"
vn-tooltip="New greuge" vn-tooltip="New greuge"
vn-acl="salesAssistant,claimManager" vn-acl="salesAssistant,claimManager"
vn-acl-action="remove" vn-acl-action="remove"
vn-bind="+" vn-bind="+"
fixed-bottom-right> fixed-bottom-right>
</vn-float-button> </vn-float-button>
<vn-worker-descriptor-popover vn-id="workerDescriptor"></vn-worker-descriptor-popover> <vn-worker-descriptor-popover vn-id="workerDescriptor"></vn-worker-descriptor-popover>

View File

@ -11,8 +11,7 @@ class Controller extends Section {
scope: { scope: {
fields: ['id', 'name'] fields: ['id', 'name']
}, },
}, }, {
{
relation: 'user', relation: 'user',
scope: { scope: {
fields: ['id', 'name'] fields: ['id', 'name']
@ -24,8 +23,6 @@ class Controller extends Section {
} }
} }
Controller.$inject = ['$element', '$scope'];
ngModule.vnComponent('vnClientGreugeIndex', { ngModule.vnComponent('vnClientGreugeIndex', {
template: require('./index.html'), template: require('./index.html'),
controller: Controller controller: Controller

View File

@ -12,11 +12,11 @@
<vn-data-viewer model="model" class="header vn-w-lg"> <vn-data-viewer model="model" class="header vn-w-lg">
<vn-card class="vn-pa-lg"> <vn-card class="vn-pa-lg">
<vn-label-value <vn-label-value
label="Total" label="Total"
value="{{::edit.model.totalVolume}} M³"> value="{{::edit.model.totalVolume}} M³">
</vn-label-value> </vn-label-value>
<vn-label-value <vn-label-value
label="Cajas" label="Cajas"
value="{{::edit.model.totalBoxes | dashIfEmpty}} U"> value="{{::edit.model.totalBoxes | dashIfEmpty}} U">
</vn-label-value> </vn-label-value>
</vn-card> </vn-card>
@ -24,7 +24,7 @@
<vn-table model="model"> <vn-table model="model">
<vn-thead> <vn-thead>
<vn-tr> <vn-tr>
<vn-th shrink field="itemFk" default-order="ASC" number>Item</vn-th> <vn-th shrink field="itemFk" number>Item</vn-th>
<vn-th>Description</vn-th> <vn-th>Description</vn-th>
<vn-th shrink field="quantity" number>Quantity</vn-th> <vn-th shrink field="quantity" number>Quantity</vn-th>
<vn-th shrink number>m³ per quantity</vn-th> <vn-th shrink number>m³ per quantity</vn-th>

View File

@ -6,9 +6,10 @@ class Controller extends Section {
constructor($element, $) { constructor($element, $) {
super($element, $); super($element, $);
this.filter = { this.filter = {
include: [{ include: {
relation: 'item' relation: 'item'
}] },
order: 'itemFk'
}; };
this.order = {}; this.order = {};
this.ticketVolumes = []; this.ticketVolumes = [];

View File

@ -1,4 +1,5 @@
<vn-crud-model auto-load="false" <vn-crud-model
auto-load="true"
vn-id="model" vn-id="model"
url="sales" url="sales"
filter="::$ctrl.filter" filter="::$ctrl.filter"
@ -10,10 +11,10 @@
<vn-card class="vn-pa-lg"> <vn-card class="vn-pa-lg">
<vn-horizontal> <vn-horizontal>
<div class="totalBox" ng-repeat="packingType in $ctrl.packingTypeVolume"> <div class="totalBox" ng-repeat="packingType in $ctrl.packingTypeVolume">
<vn-label-value label="Tipo" <vn-label-value label="Tipo"
value="{{::packingType.description}}"> value="{{::packingType.description}}">
</vn-label-value> </vn-label-value>
<vn-label-value label="Volumen" <vn-label-value label="Volumen"
value="{{::packingType.volume}}"> value="{{::packingType.volume}}">
</vn-label-value> </vn-label-value>
</div> </div>
@ -23,7 +24,7 @@
<vn-thead> <vn-thead>
<vn-tr> <vn-tr>
<vn-th field="itemFk" number>Item</vn-th> <vn-th field="itemFk" number>Item</vn-th>
<vn-th field="concept" default-order="ASC">Description</vn-th> <vn-th field="concept">Description</vn-th>
<vn-th field="itemPackingTypeFk" number>Packing type</vn-th> <vn-th field="itemPackingTypeFk" number>Packing type</vn-th>
<vn-th field="quantity" number>Quantity</vn-th> <vn-th field="quantity" number>Quantity</vn-th>
<vn-th number>m³ per quantity</vn-th> <vn-th number>m³ per quantity</vn-th>

View File

@ -5,9 +5,10 @@ class Controller extends Section {
constructor($element, $) { constructor($element, $) {
super($element, $); super($element, $);
this.filter = { this.filter = {
include: [{ include: {
relation: 'item' relation: 'item'
}] },
order: 'concept'
}; };
this.ticketVolumes = []; this.ticketVolumes = [];