From 41b49dda3b83771e9eef9cc227ffcc0ab5a0544b Mon Sep 17 00:00:00 2001 From: Oleg Zharkov Date: Tue, 12 Oct 2021 17:08:37 +0200 Subject: [PATCH] fix selenium tests and cleanup --- client/src/components/FilesDialog/FilesDialog.test.js | 6 +----- client/src/components/FilesDialog/FilesDialog.vue | 9 ++------- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/client/src/components/FilesDialog/FilesDialog.test.js b/client/src/components/FilesDialog/FilesDialog.test.js index cbcb8073710..0dde7666db7 100644 --- a/client/src/components/FilesDialog/FilesDialog.test.js +++ b/client/src/components/FilesDialog/FilesDialog.test.js @@ -5,10 +5,8 @@ import { shallowMount, createLocalVue } from "@vue/test-utils"; import flushPromises from "flush-promises"; import { BButton } from "bootstrap-vue"; import MockAdapter from "axios-mock-adapter"; -import Vue from "vue"; import axios from "axios"; import BootstrapVue from "bootstrap-vue"; -import SelectionDialogMixin from "components/SelectionDialog/SelectionDialogMixin"; import { rootId, @@ -117,7 +115,7 @@ describe("FilesDialog, file mode", () => { // assert that OK button is active expect(wrapper.vm.hasValue).toBe(true); - // unselect each file + // unselect each file applyForEachFile((file) => utils.clickOn(file)); // assert that OK button is disabled @@ -219,11 +217,9 @@ describe("FilesDialog, directory mode", () => { }); it("should select folders", async () => { - // console.log(wrapper.html()); const btn = wrapper.find("#ok-btn"); expect(btn.attributes().disabled).toBe("disabled"); - // const okBtn = buttons.find((btn) => btn.getAttribute("id") === "ok-btn"); await utils.open_root_folder(false); const folder = utils.getRenderedDirectory(directoryId); await utils.getTable().$emit("open", folder); diff --git a/client/src/components/FilesDialog/FilesDialog.vue b/client/src/components/FilesDialog/FilesDialog.vue index c22b407e7e0..0c6f22e9d3d 100644 --- a/client/src/components/FilesDialog/FilesDialog.vue +++ b/client/src/components/FilesDialog/FilesDialog.vue @@ -35,7 +35,7 @@ class="float-right ml-1 file-dialog-modal-ok" variant="primary" id="ok-btn" - @click="fileMode ? finalize : selectLeaf(currentDirectory)" + @click="fileMode ? finalize() : selectLeaf(currentDirectory)" :disabled="(fileMode && !hasValue) || isBusy || (!fileMode && urlTracker.atRoot())" > {{ fileMode ? "Ok" : "Select this folder" }} @@ -227,12 +227,7 @@ export default { }, /** Called when selection is complete, values are formatted and parsed to external callback **/ finalize: function () { - let results; - if (this.fileMode) { - results = this.model.finalize(); - } else { - results = this.currentDirectory.url; - } + const results = this.model.finalize(); this.modalShow = false; this.callback(results); },