-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix TS errors & clean some deps (#110)
- Loading branch information
Showing
14 changed files
with
2,815 additions
and
3,763 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import type Owner from '@ember/owner'; | ||
import Service from '@ember/service'; | ||
|
||
export default function (owner: Owner) { | ||
owner.register( | ||
'service:gtag', | ||
class extends Service { | ||
event() {} | ||
}, | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 22 additions & 21 deletions
43
tests/integration/components/three-preview/renderer-test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,35 @@ | ||
import { module } from 'qunit'; | ||
import { module, test } from 'qunit'; | ||
import { setupRenderingTest } from 'ember-qunit'; | ||
import { render } from '@ember/test-helpers'; | ||
import { hbs } from 'ember-cli-htmlbars'; | ||
import cases from 'qunit-parameterize'; | ||
import { Mesh, BoxGeometry } from 'three'; | ||
|
||
module('Integration | Component | three-preview/renderer', function (hooks) { | ||
setupRenderingTest(hooks); | ||
|
||
cases([ | ||
for (const { parentSize, title } of [ | ||
{ parentSize: true, title: 'with parentSize true' }, | ||
{ parentSize: false, title: 'with parentSize false' }, | ||
]).test('it handle parentSize attribute', async function ({ parentSize }, assert) { | ||
this.set('parentSize', parentSize); | ||
this.set('mesh', new Mesh(new BoxGeometry(12.12, 34.07, 56.42))); | ||
]) { | ||
test(`it handle parentSize attribute [${title}]`, async function (assert) { | ||
this.set('parentSize', parentSize); | ||
this.set('mesh', new Mesh(new BoxGeometry(12.12, 34.07, 56.42))); | ||
|
||
await render(hbs`<div style="width: 200px; height: 100px" data-test-renderer> | ||
<ThreePreview::Renderer @mesh={{this.mesh}} @parentSize={{this.parentSize}} /> | ||
</div>`); | ||
await render(hbs`<div style="width: 200px; height: 100px" data-test-renderer> | ||
<ThreePreview::Renderer @mesh={{this.mesh}} @parentSize={{this.parentSize}} /> | ||
</div>`); | ||
|
||
if (parentSize) { | ||
assert | ||
.dom('[data-test-renderer] canvas') | ||
.hasAttribute('width', '200', 'Canvas width is adapted to parent size') | ||
.hasAttribute('height', '100', 'Canvas height is adapted to parent size'); | ||
} else { | ||
assert | ||
.dom('[data-test-renderer] canvas') | ||
.hasAttribute('width', '1024', 'Canvas width is 1024') | ||
.hasAttribute('height', '768', 'Canvas height is 768'); | ||
} | ||
}); | ||
if (parentSize) { | ||
assert | ||
.dom('[data-test-renderer] canvas') | ||
.hasAttribute('width', '200', 'Canvas width is adapted to parent size') | ||
.hasAttribute('height', '100', 'Canvas height is adapted to parent size'); | ||
} else { | ||
assert | ||
.dom('[data-test-renderer] canvas') | ||
.hasAttribute('width', '1024', 'Canvas width is 1024') | ||
.hasAttribute('height', '768', 'Canvas height is 768'); | ||
} | ||
}); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.