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

@ -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>

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

@ -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"
@ -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 = [];