"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 chai_1 = require("chai");
const application_helpers_js_1 = require("../helpers/application-helpers.js");
describe('The Application Tab', () => {
    // TODO (liviurau): Update navigateToApplicationTab helper to work in docked
    // mode and remove the setup below.
    setup({ dockingMode: 'undocked' });
    it('shows Session Storage keys and values', async ({ devToolsPage, inspectedPage }) => {
        await (0, application_helpers_js_1.navigateToApplicationTab)('session-storage', devToolsPage, inspectedPage);
        await (0, application_helpers_js_1.navigateToSessionStorageForTopDomain)(devToolsPage, inspectedPage);
        const dataGridRowValues = await (0, application_helpers_js_1.getStorageItemsData)(['key', 'value'], 2, devToolsPage);
        chai_1.assert.deepEqual(dataGridRowValues, [
            {
                key: 'firstKey',
                value: 'firstValue',
            },
            {
                key: 'secondKey',
                value: '{"field":"complexValue","primitive":2}',
            },
        ]);
    });
    it('can delete selected items', async ({ devToolsPage, inspectedPage }) => {
        await (0, application_helpers_js_1.navigateToApplicationTab)('session-storage', devToolsPage, inspectedPage);
        await (0, application_helpers_js_1.navigateToSessionStorageForTopDomain)(devToolsPage, inspectedPage);
        await (0, application_helpers_js_1.selectStorageItemAtIndex)(0, devToolsPage);
        await (0, application_helpers_js_1.deleteSelectedStorageItem)(devToolsPage);
        const dataGridRowValues = await (0, application_helpers_js_1.getStorageItemsData)(['key', 'value'], 1, devToolsPage);
        chai_1.assert.deepEqual(dataGridRowValues, [
            {
                key: 'secondKey',
                value: '{"field":"complexValue","primitive":2}',
            },
        ]);
    });
});
//# sourceMappingURL=session-storage.test.js.map