Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 29 additions & 2 deletions tests/acceptance/support-test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { click, currentURL, fillIn, findAll, waitFor } from '@ember/test-helpers';
import { click, currentURL, fillIn, findAll, getSettledState, waitFor } from '@ember/test-helpers';
import { module, test } from 'qunit';

import percySnapshot from '@percy/ember';
Expand Down Expand Up @@ -206,7 +206,34 @@ test detail

await visit('/crates/nanomsg');
assert.strictEqual(currentURL(), '/crates/nanomsg');
await waitFor('[data-test-id="link-crate-report"]');

try {
await waitFor('[data-test-id="link-crate-report"]');
} catch (error) {
console.error(error);
console.log(getSettledState());
// display DOM tree for debugging
const walker = document.createTreeWalker(
document.querySelector('main'),
NodeFilter.SHOW_ELEMENT + NodeFilter.SHOW_TEXT,
);
while (walker.nextNode()) {
let current = walker.currentNode;
if (current.nodeName === '#text') {
let text = current.textContent.trim();
if (text) {
console.log(current.textContent, { current });
}
} else if (current.tagName && current.tagName !== 'path') {
console.log(
current.tagName,
[...(current.attributes ?? [])].map(({ value, name }) => `${name}=${value}`).join(','),
);
}
}
throw error;
}

await click('[data-test-id="link-crate-report"]');
assert.strictEqual(currentURL(), '/support?crate=nanomsg&inquire=crate-violation');
assert.dom('[data-test-id="crate-input"]').hasValue('nanomsg');
Expand Down
Loading