diff options
author | Stefan Giehl <stefan@matomo.org> | 2020-12-17 06:36:45 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-17 06:36:45 +0300 |
commit | 9e6094647e7151ba00e34ae234d4f6890ab52c2e (patch) | |
tree | 3c22529e0218fd6ff43725da25a24f4b01ee41a1 /tests/UI | |
parent | 4a241a72c52ebb54df3f9fa92e6fb392d22c4cd8 (diff) |
Show an error notification in UI when given date/period combination is invalid (#16840)
* Show an error notification in UI when given date/period combination is invalid
* Adds UI test
* unify usage of date/period params from url/hash
* updates ui screenshots changed due to the lastindexof change
* use indexOf when searching for multiple values
* updates submodule
* Fix broadcast.getParamValue
* remove debug code
* Adds some simple tests
* improve ui test
* do not url decode as it breaks segmentation tests
Diffstat (limited to 'tests/UI')
6 files changed, 19 insertions, 8 deletions
diff --git a/tests/UI/expected-screenshots/PeriodSelector_invalid.png b/tests/UI/expected-screenshots/PeriodSelector_invalid.png new file mode 100644 index 0000000000..d2619f419f --- /dev/null +++ b/tests/UI/expected-screenshots/PeriodSelector_invalid.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f7ce27b59d18a27a6715d7bafe67db6d74e98f93c3397f7a7430d73203996085 +size 13087 diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_actions_content_name_piece.png b/tests/UI/expected-screenshots/UIIntegrationTest_actions_content_name_piece.png index dbf184e857..bcf52b2ab9 100644 --- a/tests/UI/expected-screenshots/UIIntegrationTest_actions_content_name_piece.png +++ b/tests/UI/expected-screenshots/UIIntegrationTest_actions_content_name_piece.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:95ae2be1e685c35b0f130850c889a094aecdcd5789534e7e29c274127342486d -size 56434 +oid sha256:6149ce0090eee42e8a092d50945f5cdaa0624c77f721fe8028bedfd974c29571 +size 42554 diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_actions_content_piece.png b/tests/UI/expected-screenshots/UIIntegrationTest_actions_content_piece.png index 1bbdf3175d..42daef27f1 100644 --- a/tests/UI/expected-screenshots/UIIntegrationTest_actions_content_piece.png +++ b/tests/UI/expected-screenshots/UIIntegrationTest_actions_content_piece.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:52e9917e0985a1ca12d56830d6185c0b934d3951c7fbdd4c55fe624425b196a5 -size 51969 +oid sha256:0f5b0980e3e6896064e85e22d20b36d76fe2921cea6d8a8001745d11b98e40ee +size 41698 diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_actions_content_piece_name.png b/tests/UI/expected-screenshots/UIIntegrationTest_actions_content_piece_name.png index fc6eaf544c..7e7561263b 100644 --- a/tests/UI/expected-screenshots/UIIntegrationTest_actions_content_piece_name.png +++ b/tests/UI/expected-screenshots/UIIntegrationTest_actions_content_piece_name.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:cf7a312320d0d8cc697ea5b57fa4af8e81d0b23593e7e4548a64e75776e8b27d -size 60570 +oid sha256:8f50ef2d83bf302e6613654a76a156a0b325cf8acd226cc106011b0469d4c76a +size 49831 diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_actions_contents.png b/tests/UI/expected-screenshots/UIIntegrationTest_actions_contents.png index 95f9741b08..0dedc07fe3 100644 --- a/tests/UI/expected-screenshots/UIIntegrationTest_actions_contents.png +++ b/tests/UI/expected-screenshots/UIIntegrationTest_actions_contents.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a297468c3b51fffdeda7f8b2bacb6cd87465a528e35bba3ec792db2db34febb4 -size 43354 +oid sha256:4f61fbc94c5c769ec8a1ed633d4cded381b71310ed239d427a29c858b95eeb1b +size 29520 diff --git a/tests/UI/specs/PeriodSelector_spec.js b/tests/UI/specs/PeriodSelector_spec.js index 5e419d9c77..bfe207b918 100644 --- a/tests/UI/specs/PeriodSelector_spec.js +++ b/tests/UI/specs/PeriodSelector_spec.js @@ -126,4 +126,12 @@ describe("PeriodSelector", function () { expect(await page.screenshotSelector(selector)).to.matchImage('custom_comparison'); }); + + it('should show an error when invalid date/period combination is given', async function () { + await page.goto('about:blank'); + await page.goto(url.replace(/date=[^&#]+&/, 'date=2020-08-08,2020-08-09&')); + await page.waitFor(250); + + expect(await page.screenshotSelector(selector + ',#notificationContainer')).to.matchImage('invalid'); + }); });
\ No newline at end of file |