Replace $$ with shadowRoot.querySelector

`$$` is deprecated: https://polymer-library.polymer-project.org/2.0/docs/upgrade

One exception here is for gr-select as its not a shadow dom component,
so use `this.querySelector` instead

Change-Id: Ib3fd45298da1b44325d47932e53e6185d25c13de
This commit is contained in:
Tao Zhou
2020-03-11 10:25:16 +01:00
parent 0220e03503
commit b800561d0e
81 changed files with 1036 additions and 545 deletions

View File

@@ -72,11 +72,13 @@ limitations under the License.
const element = fixture('basic');
flush(() => {
const [menuItemEl, itemEl] = element;
const menuItem = menuItemEl.$$('gr-settings-menu-item');
const menuItem = menuItemEl.shadowRoot
.querySelector('gr-settings-menu-item');
assert.isOk(menuItem);
assert.equal(menuItem.title, 'foo');
assert.equal(menuItem.href, '#x/testplugin/bar');
const item = itemEl.$$('gr-settings-item');
const item = itemEl.shadowRoot
.querySelector('gr-settings-item');
assert.isOk(item);
assert.equal(item.title, 'foo');
assert.equal(item.anchor, 'x/testplugin/bar');