From faac33f7a68874eed95701c208ae78e412dc1af9 Mon Sep 17 00:00:00 2001 From: Brian Hough Date: Sun, 5 May 2019 12:47:06 -0400 Subject: [PATCH] test(modularScale): modularScale ratio test Test modularScale's ability to lookup preset ratio name. --- src/helpers/test/__snapshots__/modularScale.test.js.snap | 6 ++++++ src/helpers/test/modularScale.test.js | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/src/helpers/test/__snapshots__/modularScale.test.js.snap b/src/helpers/test/__snapshots__/modularScale.test.js.snap index 773729d0..a4480c16 100644 --- a/src/helpers/test/__snapshots__/modularScale.test.js.snap +++ b/src/helpers/test/__snapshots__/modularScale.test.js.snap @@ -120,6 +120,12 @@ Object { } `; +exports[`modularScale should allow properly look up preset ratio 1`] = ` +Object { + "font-size": "1.067em", +} +`; + exports[`modularScale should use perfect fourth and 1em base by default 1`] = ` Object { "font-size": "1.333em", diff --git a/src/helpers/test/modularScale.test.js b/src/helpers/test/modularScale.test.js index cbc4bf88..0aa7f7fd 100644 --- a/src/helpers/test/modularScale.test.js +++ b/src/helpers/test/modularScale.test.js @@ -21,6 +21,12 @@ describe('modularScale', () => { expect({ 'font-size': modularScale(1, 2) }).toMatchSnapshot() }) + it('should allow properly look up preset ratio', () => { + expect({ + 'font-size': modularScale(1, '1em', 'minorSecond'), + }).toMatchSnapshot() + }) + it('should allow adjusting the ratio', () => { expect({ 'font-size': modularScale(1, '1em', 1) }).toMatchSnapshot() })