fix e2e
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Bernat Exposito 2020-11-10 11:33:01 +01:00
parent e4e4f37609
commit c673f2130a
4 changed files with 5 additions and 5 deletions

View File

@ -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);

View File

@ -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();
});
});

View File

@ -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"]',

View File

@ -62,7 +62,7 @@ describe('Salix', () => {
it('should return de url image', () => {
const url = controller.getImageUrl();
expect(url).not.toBeDefined();
expect(url).toBeDefined();
});
});
});