From 0efcbbf31a8d05a6b327b73964bb74e9c7cb5c14 Mon Sep 17 00:00:00 2001 From: Diana Carrillo Date: Wed, 16 Jan 2019 17:50:43 -0600 Subject: [PATCH 1/5] =?UTF-8?q?1=20test=20m=C3=A1s.=20incomplete=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/actions.js | 58 ++-- src/components/CompanyBranch.vue | 7 +- src/components/GxBranches.vue | 8 +- src/components/GxCompanies.vue | 7 +- src/components/GxCompany.vue | 9 +- src/components/SelectBranch.vue | 2 +- src/components/__tests__/SelectBranch.spec.js | 250 +++++++++++------- src/store.js | 13 +- 8 files changed, 212 insertions(+), 142 deletions(-) diff --git a/src/actions.js b/src/actions.js index b6e42bb..28fc07e 100644 --- a/src/actions.js +++ b/src/actions.js @@ -3,38 +3,38 @@ axios.defaults.headers["Cache-Control"] = "no-cache"; axios.defaults.baseURL = "https://api-test.gestionix.com/api/v3"; export default { - async login(context) { - const { data } = await axios({ - method: "post", - url: "/users/authentication", - data: { - user: "qa@gestionix.com", - password: "gestionix" - } - }); + async login(context) { + const { data } = await axios({ + method: "post", + url: "/users/authentication", + data: { + user: "qa@gestionix.com", + password: "gestionix" + } + }); - const { access_token, user_id } = data; + const { access_token, user_id } = data; - axios.defaults.headers.common["Authorization"] = `Bearer ${access_token}`; + axios.defaults.headers.common["Authorization"] = `Bearer ${access_token}`; - return true; - }, - async getCompanies({ commit, state }) { - console.log("Dispatching action"); + return true; + }, + async getCompanies({ commit }) { + // console.log("Dispatching action"); - const { data } = await axios.get("/users/companies"); + const { data } = await axios.get("/users/companies"); - commit("setCompanies", data); + commit("setCompanies", data); - return true; - }, - async getBranches({ commit, state }, companyId) { - commit('selectCompany', companyId); - const { data } = await axios.get("/branch_offices", { - headers: { - Company: companyId - } - }); - commit("setBranches", data); - } -} \ No newline at end of file + return true; + }, + async getBranches({ commit }, companyId) { + commit("selectCompany", companyId); + const { data } = await axios.get("/branch_offices", { + headers: { + Company: companyId + } + }); + commit("setBranches", data); + } +}; diff --git a/src/components/CompanyBranch.vue b/src/components/CompanyBranch.vue index 21b2760..258505a 100644 --- a/src/components/CompanyBranch.vue +++ b/src/components/CompanyBranch.vue @@ -2,15 +2,15 @@
@@ -42,4 +42,3 @@ export default { } }; - diff --git a/src/components/GxBranches.vue b/src/components/GxBranches.vue index 31006c7..88488a6 100644 --- a/src/components/GxBranches.vue +++ b/src/components/GxBranches.vue @@ -1,8 +1,8 @@