mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-07 04:26:32 +08:00
DISABLE_THIRD_PARTY_CHECK=big clang format run against all files in front_end and test/ Bug: 1319340 Change-Id: I1fff63cb07544ccd0e3059fc901f9a48ff4af13b Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3598879 Reviewed-by: Alex Rudenko <alexrudenko@chromium.org> Commit-Queue: Jack Franklin <jacktfranklin@chromium.org> Reviewed-by: Wolfgang Beyer <wolfi@chromium.org>
69 lines
2.4 KiB
TypeScript
69 lines
2.4 KiB
TypeScript
// Copyright 2021 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 {assert} from 'chai';
|
|
|
|
import {$$, assertNotNullOrUndefined, goToResource, waitFor} from '../../shared/helper.js';
|
|
import {describe, it} from '../../shared/mocha-extensions.js';
|
|
import {
|
|
CATEGORY,
|
|
getGroupByCategoryChecked,
|
|
ISSUE,
|
|
navigateToIssuesTab,
|
|
toggleGroupByCategory,
|
|
} from '../helpers/issues-helpers.js';
|
|
|
|
describe('IssueView', async () => {
|
|
it('should be parented in issueTree when not groupedByCategory', async () => {
|
|
await goToResource('elements/element-reveal-inline-issue.html');
|
|
await navigateToIssuesTab();
|
|
|
|
if (await getGroupByCategoryChecked()) {
|
|
await toggleGroupByCategory();
|
|
}
|
|
|
|
const issue = await waitFor(ISSUE);
|
|
assertNotNullOrUndefined(issue);
|
|
const parent = await issue.evaluate(node => node.parentElement?.classList.contains('issue-category-body'));
|
|
assert.isFalse(parent);
|
|
});
|
|
|
|
it('should be parented in IssueCategoryView when groupedByCategory', async () => {
|
|
await goToResource('elements/element-reveal-inline-issue.html');
|
|
await navigateToIssuesTab();
|
|
|
|
if (!await getGroupByCategoryChecked()) {
|
|
await toggleGroupByCategory();
|
|
}
|
|
|
|
const issue = await waitFor(ISSUE);
|
|
assertNotNullOrUndefined(issue);
|
|
const parent = await issue.evaluate(node => node.parentElement?.classList.contains('issue-category-body'));
|
|
assert.isTrue(parent);
|
|
});
|
|
|
|
it('should reparent correctly after parent change', async () => {
|
|
await goToResource('elements/element-reveal-inline-issue.html');
|
|
await navigateToIssuesTab();
|
|
|
|
if (await getGroupByCategoryChecked()) {
|
|
await toggleGroupByCategory();
|
|
}
|
|
let category = await $$(CATEGORY);
|
|
assert.isEmpty(category);
|
|
const issue = await waitFor(ISSUE);
|
|
assertNotNullOrUndefined(issue);
|
|
const parent = await issue.evaluate(node => node.parentElement?.classList.contains('issue-category-body'));
|
|
assert.isFalse(parent);
|
|
await toggleGroupByCategory();
|
|
category = await $$(CATEGORY);
|
|
assert.isNotEmpty(category);
|
|
const reparentedIssue = await waitFor(ISSUE);
|
|
assertNotNullOrUndefined(issue);
|
|
const newParent =
|
|
await reparentedIssue.evaluate(node => node.parentElement?.classList.contains('issue-category-body'));
|
|
assert.isTrue(newParent);
|
|
});
|
|
});
|