From 7d5b9b066f27470fc7340e0fec5fe72724257bc2 Mon Sep 17 00:00:00 2001 From: Ihor Haidai Date: Tue, 27 Jan 2026 13:30:49 -0500 Subject: [PATCH] Add task solution --- src/isIsogram.test.js | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/src/isIsogram.test.js b/src/isIsogram.test.js index dfb16184..77a88581 100644 --- a/src/isIsogram.test.js +++ b/src/isIsogram.test.js @@ -6,4 +6,36 @@ describe('isIsogram', () => { it(`should be declared`, () => { expect(isIsogram).toBeInstanceOf(Function); }); + + it('returns true for an empty string', () => { + expect(isIsogram('')).toBe(true); + }); + + it('returns true for a word with all unique letters', () => { + expect(isIsogram('playgrounds')).toBe(true); + }); + + it('returns false for a word with repeating consecutive letters', () => { + expect(isIsogram('look')).toBe(false); + }); + + it('returns false for a word with repeating non-consecutive letters', () => { + expect(isIsogram('banana')).toBe(false); + }); + + it('treats uppercase and lowercase letters as the same', () => { + expect(isIsogram('Adam')).toBe(false); + }); + + it('returns false for a word with mixed-case duplicates', () => { + expect(isIsogram('Oops')).toBe(false); + }); + + it('returns true for a single-letter string', () => { + expect(isIsogram('A')).toBe(true); + }); + + it('returns true for a long known isogram', () => { + expect(isIsogram('subdermatoglyphic')).toBe(true); + }); });