From d35c8f3be00d71fe0de0e3eca80fd8ae5c1a01ae Mon Sep 17 00:00:00 2001 From: neo Date: Mon, 28 Oct 2024 15:59:40 +0100 Subject: [PATCH 1/2] FIX: sortingOrder value --- assets/src/components/FeaturesTable.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/src/components/FeaturesTable.js b/assets/src/components/FeaturesTable.js index c6e7f694b5..c28b52b590 100644 --- a/assets/src/components/FeaturesTable.js +++ b/assets/src/components/FeaturesTable.js @@ -53,7 +53,7 @@ export default class FeaturesTable extends HTMLElement { // Sorting attribute and direction this.sortingField = this.getAttribute('sortingField'); const sortingOrder = this.getAttribute('sortingOrder'); - this.sortingOrder = (sortingOrder !== null && ['asc', 'desc'].includes(sortingOrder)) ? this.sortingField : 'asc'; + this.sortingOrder = (sortingOrder !== null && ['asc', 'desc'].includes(sortingOrder)) ? sortingOrder : 'asc'; // open popup ? this.openPopup = (this.layerConfig && this.layerConfig.popup); From a2d1f61a8bf71f8142c92a6c5938e5a31bd428f9 Mon Sep 17 00:00:00 2001 From: neo Date: Tue, 29 Oct 2024 15:44:55 +0100 Subject: [PATCH 2/2] FIX: playwrght test about sorting order --- tests/end2end/playwright/lizmap-features-table.spec.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/end2end/playwright/lizmap-features-table.spec.js b/tests/end2end/playwright/lizmap-features-table.spec.js index e01e5c27eb..18ead79319 100644 --- a/tests/end2end/playwright/lizmap-features-table.spec.js +++ b/tests/end2end/playwright/lizmap-features-table.spec.js @@ -39,7 +39,7 @@ test.describe('Display lizmap-features-table component in popup from QGIS toolti // Get first item and check it let firstItem = lizmapFeaturesTable.locator("div.lizmap-features-table-container div.lizmap-features-table-item").first(); await expect(firstItem).toHaveAttribute('data-line-id', '1'); - await expect(firstItem).toHaveAttribute('data-feature-id', '10'); + await expect(firstItem).toHaveAttribute('data-feature-id', '17'); // Click on first item and check sub-popup firstItem.click(); @@ -47,13 +47,13 @@ test.describe('Display lizmap-features-table component in popup from QGIS toolti await expect(firstItem).toHaveClass(/popup-displayed/); let popupContainer = lizmapFeaturesTable.locator('div.lizmap-features-table-item-popup'); await expect(popupContainer).toBeVisible(); - await expect(popupContainer.locator('table.lizmapPopupTable tbody tr:first-child td')).toHaveText('10'); + await expect(popupContainer.locator('table.lizmapPopupTable tbody tr:first-child td')).toHaveText('17'); // Next item let nextItemButton = lizmapFeaturesTable.locator('div.lizmap-features-table-toolbar button.next-popup'); nextItemButton.click(); await expect(popupContainer).toBeVisible(); - await expect(popupContainer.locator('table.lizmapPopupTable tbody tr:first-child td')).toHaveText('8'); + await expect(popupContainer.locator('table.lizmapPopupTable tbody tr:first-child td')).toHaveText('9'); // Close Item let closeItemButton = lizmapFeaturesTable.locator('div.lizmap-features-table-toolbar button.close-popup');