Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flush() not rendering conditional template efficiently #5647

Open
1 task done
thuoe opened this issue Apr 13, 2020 · 1 comment
Open
1 task done

flush() not rendering conditional template efficiently #5647

thuoe opened this issue Apr 13, 2020 · 1 comment
Labels

Comments

@thuoe
Copy link

thuoe commented Apr 13, 2020

I am testing whether CSS properties will have successfully been applied to the Shadow DOM element which is wrapped in a conditional template using flush:

const assertComputed = (node, expected, property) => {
  const actual = getComputedStyle(node).getPropertyValue(property).trim();
  assert.equal(expected, actual);
};
....
// test
test('CSS properties applied within conditional template', (done) => {
   flush(() => {
      const thumbnail = player.shadowRoot.querySelector('.thumbnail');
      assertComputed(thumbnail, 'orange', '--video-thumbnail-background-color');
      done();
  });
});
<template is="dom-if" if={{showThumbnailPreview}}>
     <div id="preview_thumbnail" class="thumbnail">THUMBNAIL PREVIEW MOUSE OVER POSITION: [[xPosition]]</div>
</template>

Expected Results

Test passes

Actual Results

Error: thumbnail preview has not rendered: expected null to not equal null

Browsers Affected

  • Chrome

Versions

  • Polymer: 1.9.11
@stale
Copy link

stale bot commented Apr 18, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Apr 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant