Skip to content

Commit

Permalink
Merge branch 'staging/4.0' into feat/core/decorators/listen-observes
Browse files Browse the repository at this point in the history
  • Loading branch information
bennypowers committed Jul 10, 2024
2 parents 98f5ea6 + e7b3eee commit b2aa77f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion elements/pf-avatar/test/pf-avatar.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ describe('<pf-avatar>', function() {
beforeEach(async function() {
element = await createFixture(html`<pf-avatar @load="${onLoad}"></pf-avatar>`);
setTimeout(() => element.src = datauri);
await oneEvent(element, 'load', false);
await oneEvent(element, 'load');
});
it('loads the image', function() {
expect(loaded).to.equal(datauri);
Expand Down
10 changes: 5 additions & 5 deletions elements/pf-icon/test/pf-icon.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import bike from './rh-icon-bike.js';
const TEST_ICONS = { aed, api, atom, bike };

async function expectIconsEqual(element: PfIcon, tpl: TemplateResult) {
await oneEvent(element, 'load', false);
await oneEvent(element, 'load');
const rootNode = render(tpl, document.createDocumentFragment());
const actual = element.shadowRoot?.querySelector('svg');
const expected = (rootNode.parentNode as DocumentFragment).querySelector('svg');
Expand Down Expand Up @@ -98,7 +98,7 @@ describe('<pf-icon>', function() {
it('should hide the fallback when it successfully upgrades', async function() {
element.innerHTML = `<p>Icon failed to load.</p>`;
element.icon = 'bike';
await oneEvent(element, 'load', false);
await oneEvent(element, 'load');
expect(element.shadowRoot?.querySelector('[part=fallback]'))
.to.have.attribute('hidden');
});
Expand All @@ -107,7 +107,7 @@ describe('<pf-icon>', function() {
const newColor = 'rgb(11, 12, 13)';
element.style.setProperty('color', newColor);
element.icon = 'atom';
await oneEvent(element, 'load', false);
await oneEvent(element, 'load');
const color = getComputedStyle(element.shadowRoot!.querySelector('svg')!).getPropertyValue('color');
expect(color).to.equal(newColor);
});
Expand Down Expand Up @@ -140,7 +140,7 @@ describe('<pf-icon>', function() {
PfIcon.addIconSet('asdfasdf', () =>
import(`./rh-icon-${'bike'}.js`)
.then(m => m.default));
await oneEvent(element, 'load', false);
await oneEvent(element, 'load');
});
it(`should render the icon`, function() {
expectIconsEqual(element, bike);
Expand All @@ -155,7 +155,7 @@ describe('<pf-icon>', function() {
<pf-icon icon="no-scrubs">
<p>Image failed to load.</p>.
</pf-icon>`);
await oneEvent(element, 'error', false);
await oneEvent(element, 'error');
});
it('should display the fallback', function() {
expect(element.shadowRoot!.querySelector('svg')).to.not.be.ok;
Expand Down

0 comments on commit b2aa77f

Please sign in to comment.