-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(section title): add a component for section headings
- Loading branch information
Showing
3 changed files
with
30 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<div class="uk-flex uk-flex-between uk-flex-middle"> | ||
<h2 class="uk-margin-remove"> | ||
{{t (concat "emeis." @model ".title")}} | ||
</h2> | ||
{{#unless @noCreateLink}} | ||
<LinkTo @route="{{@model}}.new" class="uk-button uk-button-primary" data-test-new> | ||
{{t (concat "emeis." @model ".new")}} | ||
</LinkTo> | ||
{{/unless}} | ||
</div> | ||
<hr /> |
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 @@ | ||
export { default } from "ember-emeis/components/section-title"; |
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,18 @@ | ||
import { render } from "@ember/test-helpers"; | ||
import { hbs } from "ember-cli-htmlbars"; | ||
import { setupRenderingTest } from "ember-qunit"; | ||
import { module, test } from "qunit"; | ||
|
||
module("Integration | Component | section-title", function (hooks) { | ||
setupRenderingTest(hooks); | ||
|
||
test("it renders", async function (assert) { | ||
const intl = this.owner.lookup("service:intl"); | ||
intl.set("locale", "en"); | ||
|
||
await render(hbs`<SectionTitle @model="roles"/>`); | ||
|
||
assert.dom("h2").hasText("Roles"); | ||
assert.dom("[data-test-new]").hasText("Add Role"); | ||
}); | ||
}); |