Skip to content

Commit

Permalink
fix test typos
Browse files Browse the repository at this point in the history
  • Loading branch information
e111077 committed Feb 1, 2023
1 parent 1735d56 commit f3530b2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {NonDeferredCounter} from '../components/non-deferred-element.js';
reflectedStrProp={'initialized reflected'}>
</MyElement>
<NonDeferredCounter
id="deferred"
id="non-deferred"
count={10}
foo="bar">
</NonDeferredCounter>
Expand Down
14 changes: 8 additions & 6 deletions packages/astro/test/lit-element.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,18 @@ describe('LitElement test', function () {
const $ = cheerio.load(html);

// test 1: reflected reactive props are rendered as attributes
expect($('#deferred').attr('count')).to.equal('10');
expect($('#non-deferred').attr('count')).to.equal('10');

// test 2: non-reactive props are set as attributes
expect($('#deferred').attr('foo')).to.equal('bar');
expect($('#non-deferred').attr('foo')).to.equal('bar');

// test 3: components with only reflected reactive props set are deferred
expect($('#deferred').attr('defer-hydration')).to.equal('');
// test 3: components with only reflected reactive props set are not
// deferred because their state can be completely serialized via attributes
expect($('#non-deferred').attr('defer-hydration')).to.equal(undefined);

// test 4: components with non-reflected reactive props set are not deferred
expect($('#default').attr('defer-hydration')).to.equal(undefined);
// test 4: components with non-reflected reactive props set are deferred because
// their state needs to be synced with the server on the client.
expect($('#default').attr('defer-hydration')).to.equal('');
});

it('Correctly passes child slots', async () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/integrations/lit/test/server.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ describe('renderToStaticMarkup', () => {
customElements.define(tagName, class extends LitElement {});
const render = await renderToStaticMarkup(tagName);
expect(render).to.deep.equal({
html: `<${tagName} defer-hydration><template shadowroot="open"><!--lit-part--><!--/lit-part--></template></${tagName}>`,
html: `<${tagName}><template shadowroot="open"><!--lit-part--><!--/lit-part--></template></${tagName}>`,
});
});

Expand Down

0 comments on commit f3530b2

Please sign in to comment.