-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #257 from soxhub/additional-gts-test
Fix issue with gts detection when using embroider-webpack's rewritten-app.
- Loading branch information
Showing
13 changed files
with
268 additions
and
21 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
Empty file.
3 changes: 3 additions & 0 deletions
3
test-apps/embroider-app/app/components/in-app/at-class-ts/calls-has-at-class.css
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,3 @@ | ||
.text-color { | ||
color: #337 !important; | ||
} |
7 changes: 7 additions & 0 deletions
7
test-apps/embroider-app/app/components/in-app/at-class-ts/calls-has-at-class.gts
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,7 @@ | ||
import { scopedClass } from 'ember-scoped-css'; | ||
|
||
import HasAtClass from './has-at-class'; | ||
|
||
<template> | ||
<HasAtClass @class={{scopedClass "text-color"}} /> | ||
</template> |
3 changes: 3 additions & 0 deletions
3
test-apps/embroider-app/app/components/in-app/at-class-ts/has-at-class.gts
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,3 @@ | ||
<template> | ||
<p class={{@class}} ...attributes>some text</p> | ||
</template> |
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,7 @@ | ||
.has-a-style { | ||
color: rgb(0, 100, 50); | ||
} | ||
|
||
div { | ||
font-weight: bold; | ||
} |
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,3 @@ | ||
<template> | ||
<div class="has-a-style">text here</div> | ||
</template> |
1 change: 1 addition & 0 deletions
1
test-apps/embroider-app/app/components/in-app/misuse/no-css.hbs
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 @@ | ||
<p class={{scoped-class "foo"}}>No CSS here!</p> |
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
Large diffs are not rendered by default.
Oops, something went wrong.
22 changes: 22 additions & 0 deletions
22
test-apps/embroider-app/tests/integration/in-app/at-class-test.gts
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,22 @@ | ||
import { render } from '@ember/test-helpers'; | ||
import { module, test } from 'qunit'; | ||
import { setupRenderingTest } from 'ember-qunit'; | ||
|
||
import CallsAtHasClass from 'embroider-app/components/in-app/at-class-ts/calls-has-at-class'; | ||
|
||
import { scopedClass } from 'ember-scoped-css/test-support'; | ||
|
||
module('[In App] at-class-ts', function(hooks) { | ||
setupRenderingTest(hooks); | ||
|
||
test('calls component with @class', async function(assert) { | ||
await render( | ||
<template> | ||
<CallsAtHasClass /> | ||
</template> | ||
); | ||
|
||
assert.dom('p').hasClass(scopedClass('text-color', 'embroider-app/components/in-app/at-class-ts/calls-has-at-class')); | ||
assert.dom('p').hasStyle({ color: 'rgb(51, 51, 119)' }); | ||
}); | ||
}); |
22 changes: 22 additions & 0 deletions
22
test-apps/embroider-app/tests/integration/in-app/basic-test.gts
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,22 @@ | ||
import { render } from '@ember/test-helpers'; | ||
import { module, test } from 'qunit'; | ||
import { setupRenderingTest } from 'ember-qunit'; | ||
|
||
import Basic from 'embroider-app/components/in-app/basic'; | ||
|
||
import { scopedClass } from 'ember-scoped-css/test-support'; | ||
|
||
module('[In App] basic', function(hooks) { | ||
setupRenderingTest(hooks); | ||
|
||
test('has a style on an element', async function(assert) { | ||
await render( | ||
<template> | ||
<Basic /> | ||
</template> | ||
); | ||
|
||
assert.dom('div').hasClass(scopedClass('has-a-style', 'embroider-app/components/in-app/basic')); | ||
assert.dom('div').hasStyle({ color: 'rgb(0, 100, 50)', fontWeight: '700' }); | ||
}); | ||
}); |