Skip to content

Commit

Permalink
add tests for preset and update changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
kcinay055679 committed Jun 24, 2024
1 parent 1b36792 commit 86a15c9
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 5 deletions.
49 changes: 44 additions & 5 deletions frontend/tests/integration/components/encryptable/form-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,26 @@ const navServiceStub = Service.extend({
return 2;
}
}
]
],
/* eslint-enable ember/avoid-leaking-state-in-ember-objects */
selectedFolder: {
id: 1,
name: "bbt",
teamId: 1,
team: {
id: 1,
name: "bbteam",
get() {
return 1;
}
},
get(property) {
if (property === "team") {
return this.team;
}
return this[property];
}
}
});

const userServiceStub = Service.extend({
Expand Down Expand Up @@ -115,7 +133,7 @@ module("Integration | Component | encryptable/form", function (hooks) {
this.element
.querySelector("#team-power-select")
.innerText.replace(/\s+/g, " "),
"Team Select a Team"
"Team bbteam"
);

await selectChoose(
Expand Down Expand Up @@ -179,7 +197,7 @@ module("Integration | Component | encryptable/form", function (hooks) {
this.element
.querySelector("#team-power-select")
.innerText.replace(/\s+/g, " "),
"Team Wähle ein Team aus"
"Team bbteam"
);

await selectChoose(
Expand Down Expand Up @@ -243,7 +261,7 @@ module("Integration | Component | encryptable/form", function (hooks) {
this.element
.querySelector("#team-power-select")
.innerText.replace(/\s+/g, " "),
"Team Wähl äs Team us"
"Team bbteam"
);

await selectChoose(
Expand Down Expand Up @@ -314,7 +332,7 @@ module("Integration | Component | encryptable/form", function (hooks) {
this.element
.querySelector("#team-power-select")
.innerText.replace(/\s+/g, " "),
"Équipe Choisissez une équipe"
"Équipe bbteam"
);

await selectChoose(
Expand Down Expand Up @@ -543,4 +561,25 @@ module("Integration | Component | encryptable/form", function (hooks) {
assert.ok(this.element.textContent.trim().includes("Team"));
assert.ok(this.element.textContent.trim().includes("bob"));
});


test("Check prefill of team and folder", async function (assert) {
setLocale("en");

await render(hbs`<Encryptable::Form />`);

assert.equal(
this.element
.querySelector("#team-power-select .ember-power-select-selected-item")
.innerText.replace(/\s+/g, " "),
"bbteam"
);

assert.equal(
this.element
.querySelector("#folder-power-select .ember-power-select-selected-item")
.innerText.replace(/\s+/g, " "),
"bbt"
);
});
});
3 changes: 3 additions & 0 deletions public/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## Version 5.3.4
- Team and folder are now preset after user search.

## Version 5.3.4
- Fix a bug that prevents users from editing a credential after a search.

Expand Down

0 comments on commit 86a15c9

Please sign in to comment.