1
0
قرینه از https://github.com/matomo-org/matomo.git synced 2025-08-22 15:07:44 +00:00
Files
matomo/tests/UI/specs/InvalidatedPeriodVisualisation_spec.js
Michal Kleiner 9a3ef94df6 [Coding Style] Enable rule PSR12.Files.FileHeader + unify file headers (#22132)
* [Coding Style] Enable rule PSR12.Files.FileHeader

* Apply CS

* Replace Piwik with Matomo in file headers

* Unify file headers (position, no. of lines, https links)

* Rebuild dist files

* Apply CS

* Fix system test that relies on line numbers in a file that had the file header updated

---------

Co-authored-by: Stefan Giehl <stefan@matomo.org>
2024-04-20 20:50:47 +02:00

60 خطوط
2.0 KiB
JavaScript

/*!
* Matomo - free/libre analytics platform
*
* Invalidated Period Visualisation Test
*
* @link https://matomo.org
* @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
describe('InvalidatedPeriodVisualisation', function () {
const url = '?module=Widgetize&action=iframe&idSite=1&evolution_day_last_n=30'
+ '&moduleToWidgetize=UserCountry&actionToWidgetize=getCountry&viewDataTable=graphEvolution'
+ '&isFooterExpandedInDashboard=1';
before(() => {
testEnvironment.forceDataStates = {
'2012-01-08': 'invalidated',
'2012-01-09': 'invalidated',
'2012-01-10': 'invalidated',
// center point used for tooltip check
'2012-01-16': 'invalidated',
};
testEnvironment.save();
});
after(() => {
delete testEnvironment.forceDataStates;
testEnvironment.save();
});
it('should show invalidated data points', async function () {
await page.goto(url + '&period=day&date=2012-01-31');
await page.waitForNetworkIdle();
expect(await page.screenshot({ fullPage: true })).to.matchImage('graph');
});
it('tooltip for invalidated period should say "invalidated period"', async function () {
const graph = await page.$('.piwik-graph');
const boundingBox = await graph.boundingBox();
await page.mouse.move(
boundingBox.x + boundingBox.width / 2,
boundingBox.y + boundingBox.height / 2
);
const tooltipContent = await page.evaluate(() => $('.ui-tooltip').text().trim());
expect(tooltipContent).to.contain('Invalidated Period');
});
it('should show invalidated data points', async function () {
await page.goto(url + '&period=range&date=2012-01-01,2012-01-31&comparePeriods[]=range&compareDates[]=2011-12-01,2011-12-31');
await page.waitForNetworkIdle();
expect(await page.screenshot({ fullPage: true })).to.matchImage('comparison');
});
});