Skip to content

Commit

Permalink
Merge pull request #823 from Polymer/fix-modulizer-tests
Browse files Browse the repository at this point in the history
Fix modulizer tests to expect PolymerElement
  • Loading branch information
keanulee authored Dec 19, 2018
2 parents c3fe7c4 + b96b85b commit a809803
Showing 1 changed file with 25 additions and 25 deletions.
50 changes: 25 additions & 25 deletions packages/modulizer/src/test/unit/project-converter_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1322,8 +1322,8 @@ export function deepReferenceFn() {
});
assertSources(await convert(), {
'test.js': `
import { Element } from './dep.js';
class MyElement extends Element {}
import { PolymerElement } from './dep.js';
class MyElement extends PolymerElement {}
`
});
});
Expand Down Expand Up @@ -1465,8 +1465,8 @@ export const isDeep = isPath;
}),
{
'test.js': `
import { Element } from './dep.js';
class MyElement extends Element {}
import { PolymerElement } from './dep.js';
class MyElement extends PolymerElement {}
`
});
});
Expand Down Expand Up @@ -1588,13 +1588,13 @@ export const setRootPath = function(path) {
});
assertSources(await convert(), {
'test.js': `
import { Element } from './polymer.js';
import { PolymerElement } from './polymer.js';
import { html } from './html-tag.js';
/**
* @customElement
* @polymer
*/
class TestElement extends Element {
class TestElement extends PolymerElement {
static get template() {
return html\`
<h1>Hi!</h1>
Expand Down Expand Up @@ -1773,12 +1773,12 @@ export { qux as zug };
assertSources(
await convert({namespaces: [/* No explicit namespaces! */]}), {
'test.js': `
import { Element as Element$0 } from './polymer.js';
class Element extends Element$0 {}
import { PolymerElement } from './polymer.js';
class Element extends PolymerElement {}
`,

'polymer.js': `
export const Element = class Element {};
export const PolymerElement = class Element {};
`
});
});
Expand Down Expand Up @@ -1847,7 +1847,7 @@ export const Element = class Element {};
}),
{
'test.js': `
export const Element = class Element {};
export const PolymerElement = class Element {};
`,

'index.html': `
Expand Down Expand Up @@ -1894,7 +1894,7 @@ export const Element = class Element {};
}),
{
'test.js': `
export const Element = class Element {};
export const PolymerElement = class Element {};
`,

'index.html': `
Expand Down Expand Up @@ -1926,9 +1926,9 @@ export const Element = class Element {};
});
assertSources(await convert(), {
'test.js': `
import { Element } from './polymer.js';
class FooElem extends Element {}
class BarElem extends Element {}
import { PolymerElement } from './polymer.js';
class FooElem extends PolymerElement {}
class BarElem extends PolymerElement {}
`
});
});
Expand All @@ -1955,12 +1955,12 @@ class BarElem extends Element {}
});
assertSources(await convert(), {
'test.js': `
import { Element } from './polymer.js';
import { PolymerElement } from './polymer.js';
const $_documentContainer = document.createElement('template');
$_documentContainer.innerHTML = \`<div>Top</div><div>Middle</div><div>Bottom</div>\`;
document.head.appendChild($_documentContainer.content);
class FooElem extends Element {}
class BarElem extends Element {}
class FooElem extends PolymerElement {}
class BarElem extends PolymerElement {}
`
});
});
Expand Down Expand Up @@ -1995,18 +1995,18 @@ class BarElem extends Element {}
});
assertSources(await convert(), {
'test.js': `
import { Element } from './polymer.js';
import { PolymerElement } from './polymer.js';
const $_documentContainer = document.createElement('template');
$_documentContainer.innerHTML = \`<div>Random footer</div>\`;
document.head.appendChild($_documentContainer.content);
customElements.define('foo-elem', class FooElem extends Element {
customElements.define('foo-elem', class FooElem extends PolymerElement {
static get template() {
return Polymer.html\`
<div>foo-element body</div>
\`;
}
});
customElements.define('bar-elem', class BarElem extends Element {
customElements.define('bar-elem', class BarElem extends PolymerElement {
static get template() {
return Polymer.html\`
<div>bar body</div>
Expand Down Expand Up @@ -2072,27 +2072,27 @@ import '../lib.js';
});
assertSources(await convert(), {
'polymer.js': `
export const Element = class Element {};
export const PolymerElement = class Element {};
`,

'index.html': `
<div>This is some html.</div>
<script type="module" src="./polymer.js"></script>
<script type="module">
import { Element } from './polymer.js';
import { PolymerElement } from './polymer.js';
document.registerElement(
'foo-elem', class FooElem extends Element {});
'foo-elem', class FooElem extends PolymerElement {});
</script>
<script type="module">
// this should not be changed because it is a module already
document.registerElement(
'bar-elem', class BarElem extends HTMLElement {});
</script>
<script type="module">
import { Element } from './polymer.js';
import { PolymerElement } from './polymer.js';
document.registerElement(
'baz-elem', class BazElem extends Element {});
'baz-elem', class BazElem extends PolymerElement {});
</script>
`,
});
Expand Down

0 comments on commit a809803

Please sign in to comment.