"use strict";
// Copyright 2021 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('Deprecation Issues', () => {
    it('evaluation works', async ({ inspectedPage, devToolsPage }) => {
        await inspectedPage.goTo('about:blank');
        await (0, issues_helpers_js_1.navigateToIssuesTab)(devToolsPage);
        await devToolsPage.evaluate(() => {
            const issue = {
                code: 'DeprecationIssue',
                details: {
                    deprecationIssueDetails: {
                        sourceCodeLocation: {
                            url: 'empty.html',
                            lineNumber: 1,
                            columnNumber: 1,
                        },
                        // This value needs maintanance to always point to an exising deprecation.
                        type: 'LocalCSSFileExtensionRejected',
                    },
                },
            };
            // @ts-expect-error
            window.addIssueForTest(issue);
        });
        await (0, issues_helpers_js_1.expandIssue)(devToolsPage);
        const issueElement = await (0, issues_helpers_js_1.getIssueByTitle)('Deprecated feature used', devToolsPage);
        chai_1.assert.isOk(issueElement);
        const section = await (0, issues_helpers_js_1.getResourcesElement)('1 source', issueElement, '.affected-resource-label', devToolsPage);
        await (0, issues_helpers_js_1.ensureResourceSectionIsExpanded)(section, devToolsPage);
        const expectedTableRows = [
            ['empty.html:2'],
        ];
        await (0, issues_helpers_js_1.waitForTableFromResourceSectionContents)(section.content, expectedTableRows, devToolsPage);
    });
});
//# sourceMappingURL=deprecation-issues.test.js.map