Files
react-native-devtools-frontend/test/e2e/issues/issue-view-reparent_test.ts
T
Jack Franklin e839c0cf22 Enable long import wrapping for JS imports
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>
2022-05-03 10:22:12 +00:00

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);
});
});