analytics/tracker/test/hash-exclusions.spec.js
RobertJoonas 39ce850f18
exclude pages by hash when using script.exclusions.hash.js (#2172)
* account for hash part of the URL when excluding pages and using hash extension

* changelog update
2022-09-07 16:41:08 +03:00

14 lines
526 B
JavaScript

const { test } = require('./support/harness');
const { mockRequest } = require('./support/test-utils')
const { expect } = require('@playwright/test');
test.describe('combination of hash and exclusions script extensions', () => {
test('excludes by hash part of the URL', async ({ page }) => {
const plausibleRequestMock = mockRequest(page, '/api/event')
await page.goto('/hash-exclusions.html#this/hash/should/be/ignored');
expect(await plausibleRequestMock, "should not have sent event").toBeNull()
});
});