From c673f2130ac847b37db0b3514790983a5e1ec0f1 Mon Sep 17 00:00:00 2001 From: bernat Date: Tue, 10 Nov 2020 11:33:01 +0100 Subject: [PATCH] fix e2e --- back/methods/image/download.js | 2 +- back/methods/image/specs/download.spec.js | 4 ++-- e2e/helpers/selectors.js | 2 +- front/salix/components/user-popover/index.spec.js | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/back/methods/image/download.js b/back/methods/image/download.js index 76cd3c109..62be72496 100644 --- a/back/methods/image/download.js +++ b/back/methods/image/download.js @@ -65,7 +65,7 @@ module.exports = Self => { } }; const image = await Self.app.models.Image.findOne(filter); - if (!image) return; + if (!image) return false; const imageRole = image.collection().readRole().name; const hasRole = await Self.app.models.Account.hasRole(id, imageRole); diff --git a/back/methods/image/specs/download.spec.js b/back/methods/image/specs/download.spec.js index 43152a8f1..243871992 100644 --- a/back/methods/image/specs/download.spec.js +++ b/back/methods/image/specs/download.spec.js @@ -11,10 +11,10 @@ describe('image download()', () => { expect(image[1]).toEqual('image/png'); }); - it(`should don't return an image if the user don't have it`, async() => { + it(`should return false if the user don't have image`, async() => { const userId = 8; const image = await app.models.Image.download(collection, size, userId); - expect(image).toBeUndefined(); + expect(image).toBeFalse(); }); }); diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index 3df6eec8c..e79477ef4 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -2,7 +2,7 @@ export default { globalItems: { applicationsMenuButton: '#apps', - userMenuButton: '#user', + userMenuButton: 'div.side.end img', logoutButton: '#logout', applicationsMenuVisible: '.modules-menu', clientsButton: '.modules-menu [ui-sref="client.index"]', diff --git a/front/salix/components/user-popover/index.spec.js b/front/salix/components/user-popover/index.spec.js index 7afcf0104..7a088fc51 100644 --- a/front/salix/components/user-popover/index.spec.js +++ b/front/salix/components/user-popover/index.spec.js @@ -62,7 +62,7 @@ describe('Salix', () => { it('should return de url image', () => { const url = controller.getImageUrl(); - expect(url).not.toBeDefined(); + expect(url).toBeDefined(); }); }); });