-
Notifications
You must be signed in to change notification settings - Fork 49
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 #117 from salsify/fix-splattributes
Fix #116
- Loading branch information
Showing
6 changed files
with
1,501 additions
and
2 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
1 change: 1 addition & 0 deletions
1
tests/dummy/app/components/component-with-splattributes/styles.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 @@ | ||
.local-inner {} |
10 changes: 10 additions & 0 deletions
10
tests/dummy/app/components/component-with-splattributes/template.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,10 @@ | ||
{{! template-lint-disable }} | ||
{{! (seems like the alignment rule doesn't work right with splattributes) }} | ||
|
||
<div | ||
class="global-inner" | ||
local-class="local-inner" | ||
data-test-element | ||
...attributes | ||
> | ||
</div> |
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,24 @@ | ||
import { module, test } from 'qunit'; | ||
import { setupRenderingTest } from 'ember-qunit'; | ||
import { render } from '@ember/test-helpers'; | ||
import setupStyles from '../helpers/render-with-styles'; | ||
import { gte } from 'ember-compatibility-helpers'; | ||
import styles from 'dummy/components/component-with-splattributes/styles'; | ||
|
||
if (gte('3.4.0')) { | ||
module('Integration | Components with splattributes', function(hooks) { | ||
setupRenderingTest(hooks); | ||
|
||
test('inner and outer local and global classes are all present', async function(assert) { | ||
const hbs = setupStyles({ | ||
'local-outer': '--local-outer' | ||
}); | ||
|
||
await render(hbs`<ComponentWithSplattributes local-class="local-outer" class="global-outer" />`); | ||
assert.dom('[data-test-element]').hasClass('global-outer'); | ||
assert.dom('[data-test-element]').hasClass('--local-outer'); | ||
assert.dom('[data-test-element]').hasClass('global-inner'); | ||
assert.dom('[data-test-element]').hasClass(styles['local-inner']); | ||
}); | ||
}); | ||
} |
Oops, something went wrong.