diff --git a/interfaces/IBF-dashboard/src/app/components/map/map.component.ts b/interfaces/IBF-dashboard/src/app/components/map/map.component.ts index e57ca2627..20ac4bcce 100644 --- a/interfaces/IBF-dashboard/src/app/components/map/map.component.ts +++ b/interfaces/IBF-dashboard/src/app/components/map/map.component.ts @@ -332,7 +332,7 @@ export class MapComponent implements AfterViewInit, OnDestroy { index === self.findIndex((t) => t.name === value.name), ); // deduplicate based on name (for e.g. waterpoints_internal) - let detailsString = `
${this.mapLegendService.getLegendTitle()} + let detailsString = `
${this.mapLegendService.getLegendTitle()}
`; diff --git a/interfaces/IBF-dashboard/src/app/components/matrix/matrix.component.html b/interfaces/IBF-dashboard/src/app/components/matrix/matrix.component.html index 28f637db7..b0c08570e 100644 --- a/interfaces/IBF-dashboard/src/app/components/matrix/matrix.component.html +++ b/interfaces/IBF-dashboard/src/app/components/matrix/matrix.component.html @@ -5,6 +5,7 @@ { NoTriggerDataSet.UserPassword, ); }); - -test( - qase(12, 'Aggregates title should be dynamic no-trigger'), +// The test is skipped because of the bug that was identified during writing of this test +// The bug is that the marker of glofas stations cannot be disabled with the first chebox click (needs several) and it is failing on flood disaster type +// https://github.com/rodekruis/IBF-system/issues/1657 +// When the bug is fixed, the test should be unskipped +test.skip( + qase( + 12, + 'Aggregates title should be dynamic upon hovering over map district', + ), async ({ page }) => { const dashboard = new DashboardPage(page); const aggregates = new AggregatesComponent(page); @@ -45,7 +51,7 @@ test( await dashboard.navigateToFloodDisasterType(); // Assertions await aggregates.aggregateComponentIsVisible(); - await map.turnOffLayer({ layerName: 'Glofas stations' }); + await map.clickLayerCheckbox({ layerName: 'Glofas stations' }); await map.assertAggregateTitleOnHoverOverMap(); }, ); diff --git a/tests/e2e/tests/Map/AssertMapFunctionalitiesNotrigger.spec.ts b/tests/e2e/tests/Map/AssertMapFunctionalitiesNotrigger.spec.ts new file mode 100644 index 000000000..8565a8b5e --- /dev/null +++ b/tests/e2e/tests/Map/AssertMapFunctionalitiesNotrigger.spec.ts @@ -0,0 +1,73 @@ +import { test } from '@playwright/test'; +import DashboardPage from 'Pages/DashboardPage'; +import MapComponent from 'Pages/MapComponent'; +import UserStateComponent from 'Pages/UserStateComponent'; +import { qase } from 'playwright-qase-reporter'; +import { NoTriggerDataSet } from 'testData/testData.enum'; + +import { FloodsScenario } from '../../../../services/API-service/src/scripts/enum/mock-scenario.enum'; +import { + getAccessToken, + mockFloods, + resetDB, +} from '../../helpers/utility.helper'; +import LoginPage from '../../Pages/LoginPage'; + +let accessToken: string; + +test.beforeEach(async ({ page }) => { + // Login + const loginPage = new LoginPage(page); + accessToken = await getAccessToken(); + await resetDB(accessToken); + + // We should maybe create one mock for all different disaster types for now we can just use floods + await mockFloods( + FloodsScenario.NoTrigger, + NoTriggerDataSet.CountryCode, + accessToken, + ); + + await page.goto('/'); + await loginPage.login( + NoTriggerDataSet.UserMail, + NoTriggerDataSet.UserPassword, + ); +}); + +test( + qase(7, 'Verify Map functionality for no-triggered mode'), + async ({ page }) => { + const dashboard = new DashboardPage(page); + const userState = new UserStateComponent(page); + const map = new MapComponent(page); + + // Navigate to disaster type the data was mocked for + await dashboard.navigateToFloodDisasterType(); + // Assertions + await userState.headerComponentIsVisible({ + countryName: NoTriggerDataSet.CountryName, + }); + // Wait for the page to load + await dashboard.waitForLoaderToDisappear(); + await map.mapComponentIsVisible(); + + // Close the legend + await map.isLegendOpen({ legendOpen: true }); + await map.clickLegendHeader(); + await map.isLegendOpen({ legendOpen: false }); + + // Open the layer menu + await map.isLayerMenuOpen({ layerMenuOpen: false }); + await map.clickLayerMenu(); + await map.isLayerMenuOpen({ layerMenuOpen: true }); + + // Select and deselect the layer + await map.clickLayerMenu(); + await map.clickLayerCheckbox({ layerName: 'Red Cross branches' }); + await map.isLayerMenuOpen({ layerMenuOpen: true }); + + // Red Cross branches layer should be visible + await map.redCrossMarkersAreVisible(); + }, +);