Skip to content

Commit

Permalink
chore(test): query selector to be adjusted to the new elemend
Browse files Browse the repository at this point in the history
  • Loading branch information
CarloBar1 committed Dec 17, 2024
1 parent 3cd7295 commit 6b5c5e7
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions test/cosmoz-treenode-button-view.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,22 @@ suite('rtl', () => {
let treeButton;

suiteSetup(async () => {
treeButton = await fixture(html`<cosmoz-treenode-button-view .tree=${ new DefaultTree(rtlData) }>`);
treeButton = await fixture(
html`<cosmoz-treenode-button-view
.tree=${new DefaultTree(rtlData)}
></cosmoz-treenode-button-view>`,
);
});

test('button renders selected path', done => {
test('button renders selected path', (done) => {
treeButton.nodePath = '1.2.3';

// Button view label depends on a binding in a cosmoz-treenode-navigator
// stamped asynchronously, so we need to wait a bit.
setTimeout(() => {
const buttonLabel = treeButton.shadowRoot.querySelector('.pathToNode').textContent;
const buttonLabel = treeButton.shadowRoot
.querySelector('.pathToNode')
.querySelector('cosmoz-treenode').shadowRoot.textContent;
assert.isTrue(buttonLabel.endsWith('1 / 2 / 3'));
done();
}, 500);
Expand Down

0 comments on commit 6b5c5e7

Please # to comment.