mirror of
https://github.com/material-components/material-web.git
synced 2024-10-27 06:04:44 +03:00
make fixture await render if contents are attached
This commit is contained in:
parent
21a7d5d886
commit
3fe99dc4bd
@ -40,6 +40,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
|||||||
- mwc-floating-label-directive
|
- mwc-floating-label-directive
|
||||||
- mwc-top-app-bar-fixed
|
- mwc-top-app-bar-fixed
|
||||||
- mwc-top-app-bar-short
|
- mwc-top-app-bar-short
|
||||||
|
- Testing Infra:
|
||||||
|
- Tests now in TS
|
||||||
|
- Tests now all pass
|
||||||
|
-
|
||||||
|
|
||||||
## [0.6.0] - 2019-06-05
|
## [0.6.0] - 2019-06-05
|
||||||
- Upgrade lerna to 3.x
|
- Upgrade lerna to 3.x
|
||||||
|
@ -89,13 +89,17 @@ interface FixtureOptions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const fixture =
|
export const fixture =
|
||||||
(template: TemplateResult, options?: Partial<FixtureOptions>) => {
|
async (template: TemplateResult, options?: Partial<FixtureOptions>) => {
|
||||||
const opts: FixtureOptions = {...defaultOpts, ...options};
|
const opts: FixtureOptions = {...defaultOpts, ...options};
|
||||||
const tf = opts.document.createElement('test-fixture') as TestFixture;
|
const tf = opts.document.createElement('test-fixture') as TestFixture;
|
||||||
tf.shouldAttachContents = opts.shouldAttachContents;
|
tf.shouldAttachContents = opts.shouldAttachContents;
|
||||||
tf.template = template;
|
tf.template = template;
|
||||||
|
|
||||||
|
|
||||||
opts.document.body.appendChild(tf);
|
opts.document.body.appendChild(tf);
|
||||||
|
if (opts.shouldAttachContents) {
|
||||||
|
await tf.updateComplete;
|
||||||
|
}
|
||||||
|
|
||||||
return tf;
|
return tf;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user