Skip to content

Commit

Permalink
Merge pull request #252 from soxhub/make-a-gts-test
Browse files Browse the repository at this point in the history
Add more gts tests
  • Loading branch information
NullVoxPopuli authored Jul 12, 2024
2 parents f9f90a4 + dd0935c commit 1a88f81
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test-apps/classic-app/app/components/in-app/basic.css
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;
}
3 changes: 3 additions & 0 deletions test-apps/classic-app/app/components/in-app/basic.gts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<template>
<div class="has-a-style">text here</div>
</template>
23 changes: 23 additions & 0 deletions test-apps/classic-app/tests/shared-scenarios/in-app/basic-test.gts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { render } from '@ember/test-helpers';
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';

import Basic from 'classic-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('has-a-style_e8d85123f');
assert.dom('div').hasClass(scopedClass('has-a-style', 'classic-app/components/in-app/basic'));
assert.dom('div').hasStyle({ color: 'rgb(0, 100, 50)', fontWeight: '700' });
});
});

0 comments on commit 1a88f81

Please sign in to comment.