diff --git a/back/methods/vn-user/specs/signOut.js b/back/methods/vn-user/specs/signOut.js deleted file mode 100644 index e6ca1f1564..0000000000 --- a/back/methods/vn-user/specs/signOut.js +++ /dev/null @@ -1,42 +0,0 @@ -const {models} = require('vn-loopback/server/server'); - -fdescribe('VnUser signOut()', () => { - it('should logout and remove token after valid login', async() => { - let loginResponse = await app.models.VnUser.validateLogin('buyer', 'nightmare'); - let accessToken = await app.models.AccessToken.findById(loginResponse.token); - let ctx = {req: {accessToken: accessToken}}; - - let logoutResponse = await models.VnUser.logout(ctx); - let tokenAfterLogout = await models.AccessToken.findById(loginResponse.token); - - expect(logoutResponse).toBeTrue(); - expect(tokenAfterLogout).toBeNull(); - }); - - it('should throw a 401 error when token is invalid', async() => { - let error; - let ctx = {req: {accessToken: {id: 'invalidToken'}}}; - - try { - response = await models.VnUser.signOut(ctx); - } catch (e) { - error = e; - } - - expect(error).toBeDefined(); - expect(error.statusCode).toBe(401); - }); - - it('should throw an error when no token is passed', async() => { - let error; - let ctx = {req: {accessToken: null}}; - - try { - response = await models.VnUser.signOut(ctx); - } catch (e) { - error = e; - } - - expect(error).toBeDefined(); - }); -}); diff --git a/back/methods/vn-user/specs/validate-auth.spec.js b/back/methods/vn-user/specs/validate-auth.spec.js index cc2eea092b..958770b4b9 100644 --- a/back/methods/vn-user/specs/validate-auth.spec.js +++ b/back/methods/vn-user/specs/validate-auth.spec.js @@ -8,7 +8,7 @@ describe('account validateAuth()', () => { let error; try { - await models.Account.validateAuth(ctx, 'developer', 'nightmare', '123456'); + await models.VnUser.validateAuth(ctx, 'developer', 'nightmare', '123456'); } catch (e) { error = e; } @@ -28,7 +28,7 @@ describe('account validateAuth()', () => { code: '555555', expires: Date.vnNow() + (60 * 1000) }); - await models.Account.validateAuth(ctx, 'developer', 'nightmare', '555555'); + await models.VnUser.validateAuth(ctx, 'developer', 'nightmare', '555555'); await authCode.destroy(); } catch (e) { error = e; diff --git a/e2e/paths/01-salix/03_smartTable_searchBar_integrations.spec.js b/e2e/paths/01-salix/03_smartTable_searchBar_integrations.spec.js index a3d747f1cb..b2c2291c62 100644 --- a/e2e/paths/01-salix/03_smartTable_searchBar_integrations.spec.js +++ b/e2e/paths/01-salix/03_smartTable_searchBar_integrations.spec.js @@ -75,11 +75,12 @@ describe('SmartTable SearchBar integration', () => { }); }); - describe('as orders', () => { + // #5573 - The amount of rows differs when loading from side menu + // https://redmine.verdnatura.es/issues/5573 + xdescribe('as orders', () => { it('should order by first id', async() => { await page.loginAndModule('developer', 'item'); await page.accessToSection('item.fixedPrice'); - await page.doSearch(); const result = await page.waitToGetProperty(selectors.itemFixedPrice.firstItemID, 'value'); diff --git a/front/core/services/auth.js b/front/core/services/auth.js index 2ab2caa621..c1242209ea 100644 --- a/front/core/services/auth.js +++ b/front/core/services/auth.js @@ -59,7 +59,7 @@ export default class Auth { password: password || undefined }; - return this.$http.post('VnUsers/signin', params).then( + return this.$http.post('Accounts/login', params).then( json => this.onLoginOk(json, remember)); } diff --git a/modules/account/back/methods/account/login.js b/modules/account/back/methods/account/login.js index c3218172c8..a512b53307 100644 --- a/modules/account/back/methods/account/login.js +++ b/modules/account/back/methods/account/login.js @@ -23,5 +23,5 @@ module.exports = Self => { } }); - Self.login = async(user, password) => Self.app.models.VnUser.signIn(user, password); + Self.login = async(user, password) => Self.app.models.VnUser.validateLogin(user, password); };