From 0e891c69058629d4887435c43851f03c046d75e9 Mon Sep 17 00:00:00 2001 From: Jaden van Rijswijk <53235649+Jaden505@users.noreply.github.com> Date: Wed, 11 Dec 2024 10:35:36 +0100 Subject: [PATCH] [O2B-844] Filter according to B field in runs (#1803) * show * visible to false and removoe unnecessary profiles * add dipole and solenoid together test * remove redundant api test * add frontend test * update logs test to press runs element in navbar instead of using goToPage * fix linter issue * fix linter issue * fix linter issue * fix linter issue * fix linter issue * reverting back to goToPage * reverting back to goToPage * reverting back to goToPage * fix test result rows * test no check after reset an no more gotopage * fix test * remove unnecessary changes * comment in tests --- .../Runs/ActiveColumns/runsActiveColumns.js | 2 +- package-lock.json | 71 +++++++++++++------ test/public/runs/overview.test.js | 15 +++- 3 files changed, 65 insertions(+), 23 deletions(-) diff --git a/lib/public/views/Runs/ActiveColumns/runsActiveColumns.js b/lib/public/views/Runs/ActiveColumns/runsActiveColumns.js index b6f35d0f15..1c47037a75 100644 --- a/lib/public/views/Runs/ActiveColumns/runsActiveColumns.js +++ b/lib/public/views/Runs/ActiveColumns/runsActiveColumns.js @@ -502,6 +502,6 @@ export const runsActiveColumns = { name: 'L3 / Dipole', visible: false, filter: ({ aliceL3AndDipoleCurrentFilter }) => selectionDropdown(aliceL3AndDipoleCurrentFilter, { selectorPrefix: 'l3-dipole-current' }), - profiles: ['runsPerLhcPeriod', 'runsPerDataPass', 'runsPerSimulationPass'], + profiles: ['runsPerLhcPeriod', 'runsPerDataPass', 'runsPerSimulationPass', profiles.none], }, }; diff --git a/package-lock.json b/package-lock.json index cfd03dbc9f..27ae3d9386 100644 --- a/package-lock.json +++ b/package-lock.json @@ -569,13 +569,19 @@ "url": "https://opencollective.com/eslint" } }, - "node_modules/@eslint/js": { - "version": "8.57.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz", - "integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==", + "node_modules/@eslint/eslintrc/node_modules/globals": { + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", "dev": true, + "dependencies": { + "type-fest": "^0.20.2" + }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/@grpc/grpc-js": { @@ -3690,6 +3696,7 @@ "version": "8.57.0", "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz", "integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==", + "deprecated": "This version is no longer supported. Please see https://eslint.org/version-support for other options.", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", @@ -3769,6 +3776,30 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/eslint/node_modules/@eslint/js": { + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz", + "integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/eslint/node_modules/globals": { + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", + "dev": true, + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/esniff": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/esniff/-/esniff-2.0.1.tgz", @@ -4494,21 +4525,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/globals": { - "version": "13.24.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", - "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", - "dev": true, - "dependencies": { - "type-fest": "^0.20.2" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/gopd": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", @@ -8266,6 +8282,21 @@ "is-typedarray": "^1.0.0" } }, + "node_modules/typescript": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.2.tgz", + "integrity": "sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg==", + "dev": true, + "optional": true, + "peer": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, "node_modules/umzug": { "version": "3.8.0", "resolved": "https://registry.npmjs.org/umzug/-/umzug-3.8.0.tgz", diff --git a/test/public/runs/overview.test.js b/test/public/runs/overview.test.js index 96ccef4408..20573f18c5 100644 --- a/test/public/runs/overview.test.js +++ b/test/public/runs/overview.test.js @@ -334,7 +334,7 @@ module.exports = () => { it('should successfully filter on tags', async () => { await waitForTableLength(page, 8); - // Open filter toggle + // Open filter toggle and wait for the dropdown to be visible await pressElement(page, '.tags-filter .dropdown-trigger'); await pressElement(page, '#tag-dropdown-option-FOOD', true); await pressElement(page, '#tag-dropdown-option-RUN', true); @@ -596,6 +596,17 @@ module.exports = () => { expect(runDurationList.every((runDuration) => runDuration === 'UNKNOWN')).to.be.true; }); + it('should successfully apply alice currents filters', async () => { + await pressElement(page, '#reset-filters'); + + const popoverSelector = await getPopoverSelector(await page.waitForSelector('.aliceL3AndDipoleCurrent-filter .popover-trigger')); + await pressElement(page, `${popoverSelector} .dropdown-option:last-child`, true); // Select 30003kA/0kA + + await expectColumnValues(page, 'runNumber', ['54', '53', '52']); + + await pressElement(page, '#reset-filters'); + }); + it('Should successfully filter runs by their run quality', async () => { await goToPage(page, 'run-overview'); const filterInputSelectorPrefix = '#runQualityCheckbox'; @@ -1116,7 +1127,7 @@ module.exports = () => { await waitForNavigation(page, () => pressElement(page, 'a#home')); await waitForNavigation(page, () => pressElement(page, 'a#run-overview')); - // Not running run + // Not running run, wait for popover to be visible await pressElement(page, '#row104-runNumber-text .popover-trigger'); let popoverSelector = await getPopoverSelector(await page.waitForSelector('#row104-runNumber-text .popover-trigger')); await page.waitForSelector(popoverSelector);