"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 elements_helpers_js_1 = require("../helpers/elements-helpers.js");
describe('The Classes pane', () => {
    it('can add a class to the element', async ({ devToolsPage, inspectedPage }) => {
        await inspectedPage.goToResource('elements/simple-styled-page.html');
        await (0, elements_helpers_js_1.toggleClassesPane)(devToolsPage);
        await (0, elements_helpers_js_1.typeInClassesPaneInput)('foo', devToolsPage);
        await (0, elements_helpers_js_1.assertSelectedNodeClasses)(['foo'], devToolsPage);
    });
    it('can add multiple classes at once', async ({ devToolsPage, inspectedPage }) => {
        await inspectedPage.goToResource('elements/simple-styled-page.html');
        await (0, elements_helpers_js_1.toggleClassesPane)(devToolsPage);
        await (0, elements_helpers_js_1.typeInClassesPaneInput)('foo bar', devToolsPage);
        await (0, elements_helpers_js_1.assertSelectedNodeClasses)(['foo', 'bar'], devToolsPage);
    });
    it('can toggle classes', async ({ devToolsPage, inspectedPage }) => {
        await inspectedPage.goToResource('elements/simple-styled-page.html');
        await (0, elements_helpers_js_1.toggleClassesPane)(devToolsPage);
        await (0, elements_helpers_js_1.typeInClassesPaneInput)('on off', devToolsPage);
        await (0, elements_helpers_js_1.assertSelectedNodeClasses)(['on', 'off'], devToolsPage);
        await (0, elements_helpers_js_1.toggleClassesPaneCheckbox)('off', devToolsPage);
        await (0, elements_helpers_js_1.assertSelectedNodeClasses)(['on'], devToolsPage);
        await (0, elements_helpers_js_1.toggleClassesPaneCheckbox)('off', devToolsPage);
        await (0, elements_helpers_js_1.toggleClassesPaneCheckbox)('on', devToolsPage);
        await (0, elements_helpers_js_1.assertSelectedNodeClasses)(['off'], devToolsPage);
    });
    it('removes the previewed classes on ESC', async ({ devToolsPage, inspectedPage }) => {
        await inspectedPage.goToResource('elements/simple-styled-page.html');
        await (0, elements_helpers_js_1.toggleClassesPane)(devToolsPage);
        await (0, elements_helpers_js_1.typeInClassesPaneInput)('foo', devToolsPage);
        await (0, elements_helpers_js_1.typeInClassesPaneInput)('bar', devToolsPage, 'Escape', false);
        await (0, elements_helpers_js_1.typeInClassesPaneInput)('baz', devToolsPage);
        await (0, elements_helpers_js_1.assertSelectedNodeClasses)(['foo', 'baz'], devToolsPage);
    });
});
//# sourceMappingURL=classes-pane.test.js.map