diff --git a/scripts/build/package.js b/scripts/build/package.js index 37e02341..a55e0e21 100644 --- a/scripts/build/package.js +++ b/scripts/build/package.js @@ -34,12 +34,7 @@ function escape(value) { return value.replace(/(? { - const name = icon.slug || icon.title; - const subject = simpleIcons[name]; + const slug = getIconSlug(icon); + const subject = simpleIcons[slug]; test(`${icon.title} has the correct "title"`, () => { expect(typeof subject.title).toBe('string'); @@ -13,7 +13,7 @@ icons.forEach(icon => { test(`${icon.title} has the correct "slug"`, () => { expect(typeof subject.slug).toBe('string'); - expect(subject.slug).toEqual(getIconSlug(icon)); + expect(subject.slug).toEqual(slug); }); test(`${icon.title} has the correct "hex" value`, () => { @@ -59,21 +59,8 @@ icons.forEach(icon => { } }); - // NOTE: Icons with custom slugs have a custom slug because their title is - // already taken, so they should not be findable by their title. - if (icon.slug === undefined) { - test(`${icon.title} can be found by it's title`, () => { - const found = simpleIcons.get(icon.title); - expect(found).toBeDefined(); - expect(found.title).toEqual(icon.title); - expect(found.hex).toEqual(icon.hex); - expect(found.source).toEqual(icon.source); - }); - } - test(`${icon.title} can be found by it's slug`, () => { - const name = getIconSlug(icon); - const found = simpleIcons.get(name); + const found = simpleIcons.get(slug); expect(found).toBeDefined(); expect(found.title).toEqual(icon.title); expect(found.hex).toEqual(icon.hex);