Replace $$ with shadowRoot.querySelector for all ids
`$$` is deprecating Can not use `element.$` as it is a static node map and won't contain those inside of `dom-if` or `dom-repeat` Change-Id: Iea3463df3a8e5a646c3957b6b1845686a84973dd
This commit is contained in:
@@ -231,7 +231,8 @@ limitations under the License.
|
||||
.concat(_.times(11, randomMessage));
|
||||
flushAsynchronousOperations();
|
||||
|
||||
MockInteractions.tap(element.$$('#collapse-messages')); // Expand all.
|
||||
MockInteractions.tap(element.shadowRoot
|
||||
.querySelector('#collapse-messages')); // Expand all.
|
||||
flushAsynchronousOperations();
|
||||
|
||||
let messages = getMessages();
|
||||
@@ -255,8 +256,10 @@ limitations under the License.
|
||||
.concat(_.times(11, randomMessage));
|
||||
flushAsynchronousOperations();
|
||||
|
||||
MockInteractions.tap(element.$$('#collapse-messages')); // Expand all.
|
||||
MockInteractions.tap(element.$$('#collapse-messages')); // Collapse all.
|
||||
MockInteractions.tap(element.shadowRoot
|
||||
.querySelector('#collapse-messages')); // Expand all.
|
||||
MockInteractions.tap(element.shadowRoot
|
||||
.querySelector('#collapse-messages')); // Collapse all.
|
||||
flushAsynchronousOperations();
|
||||
|
||||
let messages = getMessages();
|
||||
@@ -283,13 +286,15 @@ limitations under the License.
|
||||
MockInteractions.tap(allMessageEls[1]);
|
||||
assert.isTrue(allMessageEls[1]._expanded);
|
||||
|
||||
MockInteractions.tap(element.$$('#collapse-messages'));
|
||||
MockInteractions.tap(element.shadowRoot
|
||||
.querySelector('#collapse-messages'));
|
||||
allMessageEls = getMessages();
|
||||
for (const message of allMessageEls) {
|
||||
assert.isTrue(message._expanded);
|
||||
}
|
||||
|
||||
MockInteractions.tap(element.$$('#collapse-messages'));
|
||||
MockInteractions.tap(element.shadowRoot
|
||||
.querySelector('#collapse-messages'));
|
||||
allMessageEls = getMessages();
|
||||
for (const message of allMessageEls) {
|
||||
assert.isFalse(message._expanded);
|
||||
@@ -297,28 +302,33 @@ limitations under the License.
|
||||
});
|
||||
|
||||
test('expand/collapse from external keypress', () => {
|
||||
MockInteractions.tap(element.$$('#collapse-messages'));
|
||||
MockInteractions.tap(element.shadowRoot
|
||||
.querySelector('#collapse-messages'));
|
||||
let allMessageEls = getMessages();
|
||||
for (const message of allMessageEls) {
|
||||
assert.isTrue(message._expanded);
|
||||
}
|
||||
|
||||
// Expand/collapse all text also changes.
|
||||
assert.equal(element.$$('#collapse-messages').textContent.trim(),
|
||||
'Collapse all');
|
||||
assert.equal(element.shadowRoot
|
||||
.querySelector('#collapse-messages').textContent.trim(),
|
||||
'Collapse all');
|
||||
|
||||
MockInteractions.tap(element.$$('#collapse-messages'));
|
||||
MockInteractions.tap(element.shadowRoot
|
||||
.querySelector('#collapse-messages'));
|
||||
allMessageEls = getMessages();
|
||||
for (const message of allMessageEls) {
|
||||
assert.isFalse(message._expanded);
|
||||
}
|
||||
// Expand/collapse all text also changes.
|
||||
assert.equal(element.$$('#collapse-messages').textContent.trim(),
|
||||
'Expand all');
|
||||
assert.equal(element.shadowRoot
|
||||
.querySelector('#collapse-messages').textContent.trim(),
|
||||
'Expand all');
|
||||
});
|
||||
|
||||
test('hide messages does not appear when no automated messages', () => {
|
||||
assert.isOk(element.$$('#automatedMessageToggleContainer[hidden]'));
|
||||
assert.isOk(element.shadowRoot
|
||||
.querySelector('#automatedMessageToggleContainer[hidden]'));
|
||||
});
|
||||
|
||||
test('scroll to message', () => {
|
||||
@@ -476,7 +486,8 @@ limitations under the License.
|
||||
});
|
||||
|
||||
test('hide autogenerated button is not hidden', () => {
|
||||
assert.isNotOk(element.$$('#automatedMessageToggle[hidden]'));
|
||||
assert.isNotOk(element.shadowRoot
|
||||
.querySelector('#automatedMessageToggle[hidden]'));
|
||||
});
|
||||
|
||||
test('autogenerated messages are not hidden initially', () => {
|
||||
|
||||
Reference in New Issue
Block a user