"use strict";
// Copyright 2020 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 console_helpers_js_1 = require("../helpers/console-helpers.js");
describe('The Console Tab', () => {
    it('shows the toolbar button for no issue correctly', async ({ devToolsPage, inspectedPage }) => {
        // Navigate to page which causes no issues.
        await inspectedPage.goToResource('empty.html');
        await (0, console_helpers_js_1.navigateToConsoleTab)(devToolsPage);
        await (0, console_helpers_js_1.waitForIssueButtonLabel)('No Issues', devToolsPage);
    });
    it('shows the toolbar button for one issue correctly', async ({ devToolsPage, inspectedPage }) => {
        // Navigate to page which causes a single issue.
        await inspectedPage.goToResource('elements/quirks-mode.html');
        await (0, console_helpers_js_1.navigateToConsoleTab)(devToolsPage);
        await (0, console_helpers_js_1.waitForIssueButtonLabel)('1 Issue:', devToolsPage);
    });
    it('shows the toolbar button for three issues correctly', async ({ devToolsPage, inspectedPage }) => {
        // Navigate to page which causes three issues.
        await inspectedPage.goToResource('issues/cors-issue-2.html');
        await (0, console_helpers_js_1.navigateToConsoleTab)(devToolsPage);
        await (0, console_helpers_js_1.waitForIssueButtonLabel)('3 Issues:', devToolsPage);
    });
    it('updates the toolbar button correctly', async ({ devToolsPage, inspectedPage }) => {
        // Navigate to page which causes no issues.
        await inspectedPage.goToResource('empty.html');
        await (0, console_helpers_js_1.navigateToConsoleTab)(devToolsPage);
        await (0, console_helpers_js_1.waitForIssueButtonLabel)('No Issues', devToolsPage);
        await inspectedPage.evaluate(() => {
            // Trigger a CookieIssue.
            document.cookie = 'foo=bar;samesite=None';
        });
        await (0, console_helpers_js_1.waitForIssueButtonLabel)('1 Issue:', devToolsPage);
    });
});
//# sourceMappingURL=issues-toolbar.test.js.map