"use strict";
// Copyright 2023 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
Object.defineProperty(exports, "__esModule", { value: true });
const chai_1 = require("chai");
const issues_helpers_js_1 = require("../helpers/issues-helpers.js");
describe('Bounce Tracking issue', () => {
    it('should display correct information', async ({ devToolsPage, inspectedPage }) => {
        await inspectedPage.goToResource('empty.html');
        await (0, issues_helpers_js_1.navigateToIssuesTab)(devToolsPage);
        await devToolsPage.evaluate(() => {
            const issue = {
                code: 'BounceTrackingIssue',
                details: {
                    bounceTrackingIssueDetails: {
                        trackingSites: ['example_1.test'],
                    },
                },
            };
            // @ts-expect-error
            window.addIssueForTest(issue);
            const issue2 = {
                code: 'BounceTrackingIssue',
                details: {
                    bounceTrackingIssueDetails: {
                        trackingSites: ['example_2.test'],
                    },
                },
            };
            // @ts-expect-error
            window.addIssueForTest(issue2);
        });
        await (0, issues_helpers_js_1.expandIssue)(devToolsPage);
        const issueElement = await (0, issues_helpers_js_1.getIssueByTitle)('Chrome may soon delete state for intermediate websites in a recent navigation chain', devToolsPage);
        chai_1.assert.isOk(issueElement);
        const section = await (0, issues_helpers_js_1.getResourcesElement)('2 potentially tracking websites', issueElement, undefined, devToolsPage);
        await (0, issues_helpers_js_1.ensureResourceSectionIsExpanded)(section, devToolsPage);
        const expectedTableRows = [
            ['example_1.test'],
            ['example_2.test'],
        ];
        await (0, issues_helpers_js_1.waitForTableFromResourceSectionContents)(section.content, expectedTableRows, devToolsPage);
    });
});
//# sourceMappingURL=bounce-tracking-issues.test.js.map