mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-06 20:11:38 +08:00
Fixed: 1317582 Change-Id: I78c4f04c9304137c7a2707ca8e30483a3d5d1e40 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3602505 Auto-Submit: Wolfgang Beyer <wolfi@chromium.org> Reviewed-by: Kim-Anh Tran <kimanh@chromium.org> Commit-Queue: Kim-Anh Tran <kimanh@chromium.org>
50 lines
1.7 KiB
TypeScript
50 lines
1.7 KiB
TypeScript
// Copyright 2020 The Chromium Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
import {getBrowserAndPages, goToResource} from '../../shared/helper.js';
|
|
import {describe, it} from '../../shared/mocha-extensions.js';
|
|
import {navigateToConsoleTab, waitForIssueButtonLabel} from '../helpers/console-helpers.js';
|
|
|
|
describe('The Console Tab', async () => {
|
|
it('shows the toolbar button for no issue correctly', async () => {
|
|
// Navigate to page which causes no issues.
|
|
await goToResource('empty.html');
|
|
await navigateToConsoleTab();
|
|
|
|
await waitForIssueButtonLabel('No Issues');
|
|
});
|
|
|
|
it('shows the toolbar button for one issue correctly', async () => {
|
|
// Navigate to page which causes a single issue.
|
|
await goToResource('issues/cross-origin-portal-post.html');
|
|
await navigateToConsoleTab();
|
|
|
|
await waitForIssueButtonLabel('1 Issue:');
|
|
});
|
|
|
|
it('shows the toolbar button for two issues correctly', async () => {
|
|
// Navigate to page which causes two issues.
|
|
await goToResource('issues/cross-origin-portal-post-2.html');
|
|
await navigateToConsoleTab();
|
|
|
|
await waitForIssueButtonLabel('2 Issues:');
|
|
});
|
|
|
|
it('updates the toolbar button correctly', async () => {
|
|
// Navigate to page which causes no issues.
|
|
await goToResource('empty.html');
|
|
await navigateToConsoleTab();
|
|
|
|
await waitForIssueButtonLabel('No Issues');
|
|
|
|
const {target} = getBrowserAndPages();
|
|
await target.evaluate(() => {
|
|
// Trigger a CookieIssue.
|
|
document.cookie = 'foo=bar;samesite=None';
|
|
});
|
|
|
|
await waitForIssueButtonLabel('1 Issue:');
|
|
});
|
|
});
|