/* eslint-env jest */ import { blogImagesCost } from '../blog-images'; describe('blogImagesCost', () => { it('charges the images still missing at the image price', () => { expect(blogImagesCost(3, 1)).toBe( 'It draws the 2 images still missing at 120 credits each, 240 credits in all.' ); expect(blogImagesCost(1, 0)).toBe( 'It draws the 1 image still missing at 120 credits each, 120 credits in all.' ); }); it('says nothing more is charged when every image is made', () => { expect(blogImagesCost(2, 2)).toBe( 'Its 2 images are already made, so this costs nothing more.' ); }); it('falls back to the unit price when the article suggests none', () => { expect(blogImagesCost(0, 0)).toBe('Each image costs 120 credits.'); }); });