Skip to content

Commit

Permalink
Merge branch 'develop' into add-and-view-a-spares-definition-#1161
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuadkitenge committed Jan 13, 2025
2 parents 2ad8f9f + 017b068 commit aa3e8bc
Show file tree
Hide file tree
Showing 61 changed files with 6,270 additions and 5,090 deletions.
1 change: 1 addition & 0 deletions .env.production
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ VITE_APP_INVENTORY_MANAGEMENT_SYSTEM_BUILD_DIRECTORY=/
# Must be explicitly set to false to ensure it is assigned properly (ensuring msw is excluded)
VITE_APP_INCLUDE_MSW=false
VITE_APP_BUILD_STANDALONE=false
VITE_APP_INCLUDE_CODECOV=false
USE_API_SETTINGS=false
30 changes: 30 additions & 0 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ jobs:
with:
token: ${{ secrets.CODECOV_TOKEN }}

- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}

e2e-tests:
name: End-to-End (with mock data) Tests
runs-on: ubuntu-latest
Expand Down Expand Up @@ -147,6 +153,30 @@ jobs:
with:
name: Inventory management system (with api) Screenshots
path: cypress/screenshots
bundle_analysis:
# This job triggers only if all the other jobs succeed.
needs: [lint-and-unit-test, e2e-tests, e2e-tests-api]
name: Bundle Analysis
runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4

- name: Setup Node.js
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4
with:
node-version: 20
cache: 'yarn'

- name: Install dependencies
run: |
yarn --immutable
- name: Build app for production
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: yarn build

docker:
# This job triggers only if all the other jobs succeed. It builds the Docker image and if successful,
Expand Down
925 changes: 0 additions & 925 deletions .yarn/releases/yarn-4.5.0.cjs

This file was deleted.

934 changes: 934 additions & 0 deletions .yarn/releases/yarn-4.6.0.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.5.0.cjs
yarnPath: .yarn/releases/yarn-4.6.0.cjs
29 changes: 29 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,32 @@ coverage:
target: 75
ignore:
- "inventory-management-system/src/mocks"

# Post comment if there are changes in bundle size of any size
comment:
require_bundle_changes: True

# Post comment if there are changes in bundle size exceeding 1Kb
comment:
require_bundle_changes: True
bundle_change_threshold: "1Kb"

# Post comment if there are changes in bundle size increases more than 1Mb
comment:
require_bundle_changes: "bundle_increase"
bundle_change_threshold: "1Mb"

# Post informational status (never fails) with threshold of 5%
# This is the default configuration
bundle_analysis:
warning_threshold: "5%"
status: "informational"

# Disable commit status
bundle_analysis:
status: False

# Post commit status that will fail if change is larger than threshold of 10MB
bundle_analysis:
warning_threshold: "10MB"
status: True
34 changes: 13 additions & 21 deletions cypress/e2e/with_api/catalogueCategories/functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,62 +40,54 @@ const modifyCatalogueCategory = (
if (!values.editCatalogueCategoryName)
cy.findByLabelText('Catalogue Items').click();

// Add any required fields
for (let i = 0; i < values.newFormFields.length; i++) {
cy.findByRole('button', {
name: 'Add catalogue category field entry',
}).click();
}

cy.findAllByLabelText('Property Name *').should(
'have.length',
values.newFormFields.length
);

for (let i = 0; i < values.newFormFields.length; i++) {
const field = values.newFormFields[i];

cy.findByText('Add Property').click();
cy.findByRole('dialog', { name: 'Add Property' }).should('exist');

if (field.name) {
cy.findAllByLabelText('Property Name *').eq(i).type(field.name);
cy.findByLabelText('Property Name *').type(field.name);
}

if (field.type) {
cy.findAllByLabelText('Select Type *').eq(i).click();
cy.findByLabelText('Select Type *').click();
cy.findByRole('option', {
name: field.type.charAt(0).toUpperCase() + field.type.slice(1),
}).click();
}

if (field.unit) {
cy.findAllByLabelText('Select Unit').eq(i).click();
cy.findByLabelText('Select Unit').click();
cy.findByRole('option', { name: field.unit }).click();
}

cy.findAllByLabelText('Select is mandatory?').eq(i).click();
cy.findByLabelText('Select is mandatory?').click();
cy.findByRole('option', {
name: field.mandatory ? 'Yes' : 'No',
}).click();

if (field.allowed_values) {
cy.findAllByLabelText('Select Allowed values *').eq(i).click();
cy.findByLabelText('Select Allowed values *').click();
cy.findByRole('option', {
name: field.allowed_values.type === 'list' ? 'List' : 'Any',
}).click();

if (field.allowed_values.type === 'list') {
for (let j = 0; j < field.allowed_values.values.length; j++) {
cy.findAllByRole('button', {
cy.findByRole('button', {
name: `Add list item`,
})
.eq(i)
.click();
}).click();

cy.findAllByLabelText('List item')
.eq(j)
.type(field.allowed_values.values[j]);
}
}
}

cy.findByRole('button', { name: 'Save' }).click();
cy.findByRole('dialog', { name: 'Add Property' }).should('not.exist');
}
}

Expand Down
6 changes: 4 additions & 2 deletions cypress/e2e/with_api/systems/functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ export const copyToSystems = (values: {
.click();
}

cy.findByRole('button', { name: 'Copy to' }).click();
cy.findByRole('button', { name: 'Systems more options' }).click();
cy.findByRole('menuitem', { name: 'Copy to' }).click();

cy.findByRole('dialog').within(() => {
cy.findByText('Storage').click();
Expand Down Expand Up @@ -109,7 +110,8 @@ export const moveToSystems = (values: {
.click();
}

cy.findByRole('button', { name: 'Move to' }).click();
cy.findByRole('button', { name: 'Systems more options' }).click();
cy.findByRole('menuitem', { name: 'Move to' }).click();

cy.findByRole('dialog').within(() => {
cy.findByText('Storage').click();
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/with_api/systems/systems.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import {
addSystems,
copyToSystems,
deleteSystem,
duplicateSystem,
editSystems,
modifySystem,
moveItemToSystem,
moveToSystems,
duplicateSystem,
} from './functions';

describe('systems', () => {
Expand Down
Loading

0 comments on commit aa3e8bc

Please sign in to comment.