Skip to content

Commit 9b0745b

Browse files
committed
Update UI screenshots and fix tests
1 parent 5e6a1da commit 9b0745b

26 files changed

+69
-44
lines changed
Lines changed: 2 additions & 2 deletions
Loading

β€Žplugins/SegmentEditor/javascripts/Segmentation.jsβ€Ž

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,9 @@ Segmentation = (function($) {
520520
const comparisonService = window.CoreHome.ComparisonsStoreInstance;
521521
const segmentDefinition = $button.closest('li').data('definition');
522522
if ($button.attr('data-state') === 'active') {
523-
comparisonService.removeSegmentComparisonByDefinition(segmentDefinition);
523+
if (segmentDefinition) {
524+
comparisonService.removeSegmentComparisonByDefinition(segmentDefinition);
525+
}
524526
} else {
525527
comparisonService.addSegmentComparison({
526528
segment: segmentDefinition,
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*!
2+
* Matomo - free/libre analytics platform
3+
*
4+
* SegmentEditor screenshot tests.
5+
*
6+
* @link https://matomo.org
7+
* @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
8+
*/
9+
10+
describe("SegmentManagementPageTest", function () {
11+
var generalParams = 'idSite=1&period=range&date=2010-03-06,2010-03-08';
12+
var url = '?module=CoreHome&action=index&' + generalParams + '#?' + generalParams + '&category=General_Visitors&subcategory=CoreHome_Segments';
13+
14+
it("should load correctly", async function() {
15+
await page.goto(url);
16+
await page.waitForNetworkIdle();
17+
18+
expect(await page.screenshot({ fullPage: true })).to.matchImage('initial');
19+
});
20+
});

β€Žplugins/SegmentEditor/tests/UI/SegmentSelectorCompare_spec.jsβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ describe('SegmentComparison', () => {
2828
maxSegments);
2929

3030
// We check that the title attribute is still not the max limit message
31-
let title = await page.$eval('.segmentationContainer .segmentList li:last-child', (el) => el.getAttribute('title'));
31+
let title = await page.$eval('.segmentationContainer .segmentList li:last-child .compareSegment', (el) => el.getAttribute('title'));
3232
expect(title).to.not.equal(maxLimitMessage);
3333

3434
await page.waitForSelector('.segmentationContainer');

β€Žplugins/SegmentEditor/tests/UI/SegmentSelectorEditor_spec.jsβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ describe("SegmentSelectorEditorTest", function () {
320320
await page.goto(url);
321321

322322
await page.click('.segmentationContainer .title');
323-
await page.click('a.add_new_segment');
323+
await page.click('button.add_new_segment');
324324
await page.type('input.edit_segment_name', 'complex segment');
325325

326326
await page.waitForSelector('.segmentRow0');
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading

0 commit comments

Comments
Β (0)