Skip to content

Commit 64d1496

Browse files
committed
fix prettier and last integration test
1 parent 44789ea commit 64d1496

File tree

3 files changed

+5
-18
lines changed

3 files changed

+5
-18
lines changed

Diff for: frontend/app/components/encryptable/form.js

-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ export default class Form extends BaseFormComponent {
8484
withSymbols = this.withSymbols,
8585
passwordLength = this.passwordLength
8686
) {
87-
console.log("tes");
8887
let pass = "";
8988
const array = new Uint32Array(1);
9089
const PASSWORD_CHARS =

Diff for: frontend/app/templates/components/encryptable/form.hbs

+3-3
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,11 @@
7777
<Input
7878
id="withSymbols"
7979
@type="checkbox"
80-
@checked={{this.withSymbols}} {{on "change" (fn this.setRandomPassword invertedWithSymbols passwordLength)}}></Input>
80+
@checked={{this.withSymbols}} {{on "change" (fn this.setRandomPassword this.invertedWithSymbols this.passwordLength)}}></Input>
8181
</label>
8282
<label for="formControlRange">
83-
{{passwordLength}}
84-
<Input @type="range" class="custom-range" id="formControlRange" @value={{passwordLength}} min="16" max="32" {{on "change" (fn setRandomPassword this.withSymbols passwordLength)}}>
83+
{{this.passwordLength}}
84+
<Input @type="range" class="custom-range" id="formControlRange" @value={{this.passwordLength}} min="14" max="32" {{on "change" (fn setRandomPassword this.withSymbols passwordLength)}}>
8585
</Input>
8686
</label>
8787
</div>

Diff for: frontend/tests/integration/components/encryptable/form-test.js

+2-14
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,11 @@
11
import { module, test } from "qunit";
22
import { setupRenderingTest } from "ember-qunit";
3-
import {
4-
click,
5-
render,
6-
triggerKeyEvent,
7-
pauseTest,
8-
triggerEvent,
9-
find
10-
} from "@ember/test-helpers";
3+
import { click, render, triggerEvent } from "@ember/test-helpers";
114
import { hbs } from "ember-cli-htmlbars";
125
import Service from "@ember/service";
136
import { clickTrigger } from "ember-power-select/test-support/helpers";
147
import { selectChoose } from "ember-power-select/test-support";
158
import { setLocale } from "ember-intl/test-support";
16-
import { scrollTo } from "@ember/test-helpers";
179

1810
const navServiceStub = Service.extend({
1911
/* eslint-disable ember/avoid-leaking-state-in-ember-objects */
@@ -337,16 +329,12 @@ module("Integration | Component | encryptable/form", function (hooks) {
337329
);
338330
});
339331

340-
//Last test to fix
341-
//The function in called correctly but the value passwordLength isnt updated
342332
test("Password with the right length should be generated", async function (assert) {
343333
await render(hbs`<Encryptable::Form />`);
344334
const slider = this.element.querySelector("input#formControlRange");
345335
slider.value = 17;
346-
await triggerEvent(slider, "change");
347336
await triggerEvent(slider, "input");
348-
await pauseTest();
349-
console.log(slider.value);
337+
await triggerEvent(slider, "change");
350338
assert.equal(
351339
this.element.querySelector("input[name='cleartextPassword']").value
352340
.length,

0 commit comments

Comments
 (0)