From dbe1d80eb23a9d7deff1eb2acc85c0b3fca18c88 Mon Sep 17 00:00:00 2001 From: Yanick Minder Date: Tue, 11 Jun 2024 13:15:13 +0200 Subject: [PATCH] Fix translation tests --- frontend/app/components/encryptable/form.js | 2 +- .../templates/components/encryptable/form.hbs | 49 ++++++++++--------- .../components/encryptable/form-test.js | 42 ++++++++-------- 3 files changed, 50 insertions(+), 43 deletions(-) diff --git a/frontend/app/components/encryptable/form.js b/frontend/app/components/encryptable/form.js index c6fe764eb..4336517b5 100644 --- a/frontend/app/components/encryptable/form.js +++ b/frontend/app/components/encryptable/form.js @@ -90,7 +90,7 @@ export default class Form extends BaseFormComponent { } get availableFolders() { - return this.store.query("folder", { teamId: this.selectedTeam.get("id")}) + return this.store.query("folder", { teamId: this.selectedTeam?.get("id")}) } @action diff --git a/frontend/app/templates/components/encryptable/form.hbs b/frontend/app/templates/components/encryptable/form.hbs index 6748d85ea..15ce6b888 100644 --- a/frontend/app/templates/components/encryptable/form.hbs +++ b/frontend/app/templates/components/encryptable/form.hbs @@ -37,34 +37,39 @@
- - - {{#if team.isPersonalTeam }} + + + {{#if team.isPersonalTeam }} {{this.userService.username}} {{else}} {{team.name}} {{/if}} - - +
- - - {{folder.name}} - - + + + + {{folder.name}} +
diff --git a/frontend/tests/integration/components/encryptable/form-test.js b/frontend/tests/integration/components/encryptable/form-test.js index fa3c79eb6..942d654b5 100644 --- a/frontend/tests/integration/components/encryptable/form-test.js +++ b/frontend/tests/integration/components/encryptable/form-test.js @@ -98,8 +98,10 @@ module("Integration | Component | encryptable/form", function (hooks) { hooks.beforeEach(function () { this.owner.unregister("service:store"); - this.owner.register("service:store", storeStub); this.owner.unregister("service:navService"); + this.owner.unregister("service:userService"); + + this.owner.register("service:store", storeStub); this.owner.register("service:navService", navServiceStub); this.owner.register("service:userService", userServiceStub); }); @@ -111,7 +113,7 @@ module("Integration | Component | encryptable/form", function (hooks) { assert.equal( this.element - .querySelector("#encryptable-form-team") + .querySelector("#team-power-select") .innerText.replace(/\s+/g, " "), "Team Select a Team" ); @@ -123,7 +125,7 @@ module("Integration | Component | encryptable/form", function (hooks) { assert.equal( this.element - .querySelector("#encryptable-form-team") + .querySelector("#team-power-select") .innerText.replace(/\s+/g, " "), "Team bbteam" ); @@ -135,9 +137,9 @@ module("Integration | Component | encryptable/form", function (hooks) { assert.equal( this.element - .querySelector("#encryptable-form-folder") + .querySelector("#folder-power-select") .innerText.replace(/\s+/g, " "), - "Folder bbt" + "Folder bbt ×" ); assert.equal( @@ -175,9 +177,9 @@ module("Integration | Component | encryptable/form", function (hooks) { assert.equal( this.element - .querySelector("#encryptable-form-team") + .querySelector("#team-power-select") .innerText.replace(/\s+/g, " "), - "Team Wählen Sie ein Team aus" + "Team Wähle ein Team aus" ); await selectChoose( @@ -187,7 +189,7 @@ module("Integration | Component | encryptable/form", function (hooks) { assert.equal( this.element - .querySelector("#encryptable-form-team") + .querySelector("#team-power-select") .innerText.replace(/\s+/g, " "), "Team bbteam" ); @@ -199,9 +201,9 @@ module("Integration | Component | encryptable/form", function (hooks) { assert.equal( this.element - .querySelector("#encryptable-form-folder") + .querySelector("#folder-power-select") .innerText.replace(/\s+/g, " "), - "Ordner bbt" + "Ordner bbt ×" ); assert.equal( @@ -239,7 +241,7 @@ module("Integration | Component | encryptable/form", function (hooks) { assert.equal( this.element - .querySelector("#encryptable-form-team") + .querySelector("#team-power-select") .innerText.replace(/\s+/g, " "), "Team Wähl äs Team us" ); @@ -251,14 +253,14 @@ module("Integration | Component | encryptable/form", function (hooks) { assert.equal( this.element - .querySelector("#encryptable-form-team") + .querySelector("#team-power-select") .innerText.replace(/\s+/g, " "), "Team bbteam" ); assert.equal( this.element - .querySelector("#encryptable-form-folder") + .querySelector("#folder-power-select") .innerText.replace(/\s+/g, " "), "Ordner Wähl ä Ordner us" ); @@ -270,9 +272,9 @@ module("Integration | Component | encryptable/form", function (hooks) { assert.equal( this.element - .querySelector("#encryptable-form-folder") + .querySelector("#folder-power-select") .innerText.replace(/\s+/g, " "), - "Ordner bbt" + "Ordner bbt ×" ); assert.equal( @@ -310,7 +312,7 @@ module("Integration | Component | encryptable/form", function (hooks) { assert.equal( this.element - .querySelector("#encryptable-form-team") + .querySelector("#team-power-select") .innerText.replace(/\s+/g, " "), "Équipe Choisissez une équipe" ); @@ -322,14 +324,14 @@ module("Integration | Component | encryptable/form", function (hooks) { assert.equal( this.element - .querySelector("#encryptable-form-team") + .querySelector("#team-power-select") .innerText.replace(/\s+/g, " "), "Équipe bbteam" ); assert.equal( this.element - .querySelector("#encryptable-form-folder") + .querySelector("#folder-power-select") .innerText.replace(/\s+/g, " "), "Dossier Choisissez un dossier" ); @@ -341,9 +343,9 @@ module("Integration | Component | encryptable/form", function (hooks) { assert.equal( this.element - .querySelector("#encryptable-form-folder") + .querySelector("#folder-power-select") .innerText.replace(/\s+/g, " "), - "Dossier bbt" + "Dossier bbt ×" ); assert.equal(