add one more test for input passing && check for customImage == ''

pull/151/head
Kai Biermeier 2020-09-18 18:19:42 +02:00
parent 931f79417e
commit 03b2c3c31c
No known key found for this signature in database
GPG Key ID: 7CC9CD98828758A3
3 changed files with 14 additions and 2 deletions

File diff suppressed because one or more lines are too long

View File

@ -83,7 +83,7 @@ class ImageTag {
toString() {
const { image, tag } = this;
if (this.customImage) {
if (this.customImage && this.customImage !== '') {
return this.customImage;
}

View File

@ -20,6 +20,18 @@ describe('Input', () => {
expect(spy).toHaveBeenCalledTimes(1);
});
});
describe('customImage', () => {
it('returns the default value', () => {
expect(Input.customImage).toStrictEqual('');
});
it('takes input from the users workflow', () => {
const mockValue = '2020.4.99f9';
const spy = jest.spyOn(core, 'getInput').mockReturnValue(mockValue);
expect(Input.customImage).toStrictEqual(mockValue);
expect(spy).toHaveBeenCalledTimes(1);
});
});
describe('targetPlatform', () => {
it('returns the default value', () => {