Skip to content

Commit

Permalink
Functional Tests : BO - Stocks - Movements - Filter by category, move…
Browse files Browse the repository at this point in the history
…ment type, employee and period
  • Loading branch information
Progi1984 committed Sep 22, 2023
1 parent 2a50b71 commit b90fa9b
Show file tree
Hide file tree
Showing 14 changed files with 1,129 additions and 7,739 deletions.
5 changes: 4 additions & 1 deletion admin-dev/themes/new-theme/js/app/widgets/ps-select.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
*-->
<template>
<div class="ps-select">
<div
class="ps-select"
:id="itemId"
>
<select
class="form-control"
v-model="selected"
Expand Down
2 changes: 2 additions & 0 deletions admin-dev/themes/new-theme/js/app/widgets/ps-tree/ps-tree.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,15 @@
<button
class="btn btn-text text-uppercase pointer"
@click="expand"
data-action="expand"
>
<i class="material-icons">keyboard_arrow_down</i>
<span v-if="translations">{{ translations.expand }}</span>
</button>
<button
class="btn btn-text float-right text-uppercase pointer"
@click="reduce"
data-action="reduce"
>
<i class="material-icons">keyboard_arrow_up</i>
<span v-if="translations">{{ translations.reduce }}</span>
Expand Down

Large diffs are not rendered by default.

53 changes: 53 additions & 0 deletions tests/UI/commonTests/BO/catalog/stock.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
// Import utils
import testContext from '@utils/testContext';

import {expect} from 'chai';
import {createConnection} from 'mysql2/promise';
import type {Connection} from 'mysql2/promise';

let dbConnection: Connection;

/**
* Function to clean all Stock Movements
* @param baseContext {string} String to identify the test
*/
function cleanTableStockMovements(baseContext: string = 'commonTests-cleanTableStockMovements'): void {
const dbPrefix: string = global.INSTALL.DB_PREFIX;

describe(`Clean table ${dbPrefix}stock_mvt`, async () => {
// before and after functions
before(async () => {
if (!global.GENERATE_FAILED_STEPS) {
dbConnection = await createConnection({
user: global.INSTALL.DB_USER,
password: global.INSTALL.DB_PASSWD,
host: `my_prestashop_${global.INSTALL.DB_SERVER}_1`,
port: 3306,
database: global.INSTALL.DB_NAME,
connectionLimit: 5,
debug: true,
});
}
});

after(async () => {
if (dbConnection) {
await dbConnection.end();
}
});

it(`should remove all lines in ${dbPrefix}stock_mvt`, async function () {
await testContext.addContextItem(this, 'testIdentifier', 'truncateTable', baseContext);

await dbConnection.execute(`TRUNCATE TABLE ${dbPrefix}stock_mvt`);

const [rows] = await dbConnection.query({
sql: `SELECT * FROM ${dbPrefix}stock_mvt`,
rowsAsArray: true,
});
expect(rows).to.be.length(0);
});
});
}

export default cleanTableStockMovements;
14 changes: 7 additions & 7 deletions tests/UI/data/types/product.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,25 +92,25 @@ type ProductCombinationBulk = {

type ProductCombinationBulkRetailPrice = {
costPriceToEnable: boolean
costPrice: number
costPrice?: number
impactOnPriceTIncToEnable: boolean
impactOnPriceTInc: number
impactOnPriceTInc?: number
impactOnWeightToEnable: boolean
impactOnWeight: number
impactOnWeight?: number
}

type ProductCombinationBulkSpecificReferences = {
referenceToEnable: boolean
reference: string
reference?: string
}

type ProductCombinationBulkStock = {
quantityToEnable: boolean
quantity: number
quantity?: number
minimalQuantityToEnable: boolean
minimalQuantity: number
minimalQuantity?: number
stockLocationToEnable: boolean
stockLocation: string
stockLocation?: string
};

type ProductCustomization = {
Expand Down

0 comments on commit b90fa9b

Please sign in to comment.