-
Notifications
You must be signed in to change notification settings - Fork 10
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 #992 from adfinis/interest-link
feat(ebmber): add links from interest to identity
- Loading branch information
Showing
16 changed files
with
168 additions
and
30 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
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 |
---|---|---|
@@ -1,8 +1,11 @@ | ||
import Controller from "@ember/controller"; | ||
import { action } from "@ember/object"; | ||
import { inject as service } from "@ember/service"; | ||
|
||
export default class InterestsAddController extends Controller { | ||
@service router; | ||
|
||
@action onSave(interest) { | ||
this.transitionToRoute("interests.edit", interest.id); | ||
this.router.transitionTo("interests.edit", interest.id); | ||
} | ||
} |
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
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,90 @@ | ||
import { visit, fillIn, click, waitFor, currentURL } from "@ember/test-helpers"; | ||
import { setupMirage } from "ember-cli-mirage/test-support"; | ||
import { setupIntl } from "ember-intl/test-support"; | ||
import { setupApplicationTest } from "ember-qunit"; | ||
import { authenticateSession } from "ember-simple-auth/test-support"; | ||
import { module, test } from "qunit"; | ||
|
||
module("Acceptance | interest", function (hooks) { | ||
setupApplicationTest(hooks); | ||
setupMirage(hooks); | ||
setupIntl(hooks); | ||
|
||
hooks.beforeEach(async function () { | ||
this.category = this.server.create("interest-category"); | ||
|
||
await authenticateSession({ | ||
access_token: "123qweasdyxc", | ||
userinfo: { mysagw_groups: ["sagw"] }, | ||
}); | ||
|
||
await visit("/interests"); | ||
}); | ||
|
||
test("can list", async function (assert) { | ||
assert.dom("[data-test-category]").exists({ count: 1 }); | ||
assert.dom("[data-test-interest]").exists({ count: 3 }); | ||
}); | ||
|
||
test("can add new category", async function (assert) { | ||
await click("[data-test-category-add]"); | ||
|
||
assert.strictEqual(currentURL(), "/interests/add"); | ||
|
||
// create new category | ||
await fillIn("[data-test-input-title]", "Apple"); | ||
await fillIn("[data-test-input-description]", "Pear"); | ||
await click("[data-test-input-public]"); | ||
|
||
await click("[data-test-save]"); | ||
|
||
assert.ok(currentURL().includes("/edit/")); | ||
|
||
await click("[data-test-interest-add]"); | ||
|
||
// create new interest | ||
await fillIn("[data-test-new-interest-title]", "Melon"); | ||
await fillIn("[data-test-new-interest-description]", "Pumpkin"); | ||
await click("[data-test-new-interest-save]"); | ||
|
||
await click("[data-test-save-back]"); | ||
|
||
assert.dom("[data-test-category]").exists({ count: 2 }); | ||
|
||
assert | ||
.dom('[data-test-category="Apple"] [data-test-category-title]') | ||
.hasText("Apple"); | ||
assert | ||
.dom('[data-test-category="Apple"] [data-test-category-description]') | ||
.hasText("Pear"); | ||
assert | ||
.dom('[data-test-category="Apple"] [data-test-category-public]') | ||
.exists({ count: 1 }); | ||
|
||
assert | ||
.dom('[data-test-category="Apple"] [data-test-interest]') | ||
.exists({ count: 1 }); | ||
assert | ||
.dom('[data-test-category="Apple"] [data-test-interest-title]') | ||
.hasText("Melon"); | ||
assert | ||
.dom('[data-test-category="Apple"] [data-test-interest-description]') | ||
.hasText("Pumpkin"); | ||
}); | ||
|
||
test("can delete category", async function (assert) { | ||
await click("[data-test-category-delete]"); | ||
|
||
await waitFor(".uk-modal.uk-open"); | ||
|
||
await click(".uk-modal button.uk-button-primary"); | ||
|
||
assert.dom("[data-test-category]").doesNotExist(); | ||
}); | ||
|
||
test("interest is linked", async function (assert) { | ||
await click(`[data-test-interest]:first-child [data-test-interest-title]`); | ||
|
||
assert.ok(currentURL().includes("/identities?searchTerm=%22")); | ||
}); | ||
}); |
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.