From 2ca033d6d13104feb22d73f0d8171ee90b9c879d Mon Sep 17 00:00:00 2001 From: bl00dymarie Date: Mon, 25 Mar 2024 15:03:40 +0100 Subject: [PATCH] Update internal Nfp wording --- lib/nfp-mucus.js | 2 +- test/nfp-mucus.spec.js | 79 ++++++++++++++++++++++++++++++++++++ test/sensiplan-mucus.spec.js | 79 ------------------------------------ 3 files changed, 80 insertions(+), 80 deletions(-) create mode 100644 test/nfp-mucus.spec.js delete mode 100644 test/sensiplan-mucus.spec.js diff --git a/lib/nfp-mucus.js b/lib/nfp-mucus.js index f5dbb9e..c0ea3d7 100644 --- a/lib/nfp-mucus.js +++ b/lib/nfp-mucus.js @@ -1,4 +1,4 @@ -export default function getSensiplanMucus(feeling, texture) { +export default function getNfpMucus(feeling, texture) { if (typeof feeling != 'number' || typeof texture != 'number') return null const feelingMapping = { diff --git a/test/nfp-mucus.spec.js b/test/nfp-mucus.spec.js new file mode 100644 index 0000000..401ed22 --- /dev/null +++ b/test/nfp-mucus.spec.js @@ -0,0 +1,79 @@ +import getNfpMucus from '../lib/nfp-mucus' + +describe('getNfpMucus', () => { + test('returns null if there is no value for feeling or texture', () => { + expect(getNfpMucus()).toBeNull() + expect(getNfpMucus(undefined, 3)).toBeNull() + expect(getNfpMucus(2, undefined)).toBeNull() + }) + + describe('results in t for:', () => { + test('dry feeling and no texture', function () { + const nfpValue = getNfpMucus(0, 0) + expect(nfpValue).toEqual(0) + }) + }) + + describe('results in Ø for:', () => { + test('no feeling and no texture', function () { + const nfpValue = getNfpMucus(1, 0) + expect(nfpValue).toEqual(1) + }) + }) + + describe('results in f for:', () => { + test('wet feeling and no texture', function () { + const nfpValue = getNfpMucus(2, 0) + expect(nfpValue).toEqual(2) + }) + }) + + describe('results in S for:', () => { + test('dry feeling and creamy texture', function () { + const nfpValue = getNfpMucus(0, 1) + expect(nfpValue).toEqual(3) + }) + + test('no feeling and creamy texture', function () { + const nfpValue = getNfpMucus(1, 1) + expect(nfpValue).toEqual(3) + }) + + test('wet feeling and creamy texture', function () { + const nfpValue = getNfpMucus(2, 1) + expect(nfpValue).toEqual(3) + }) + }) + + describe('results in +S for:', () => { + test('dry feeling and egg white texture', function () { + const nfpValue = getNfpMucus(0, 2) + expect(nfpValue).toEqual(4) + }) + + test('no feeling and egg white texture', function () { + const nfpValue = getNfpMucus(1, 2) + expect(nfpValue).toEqual(4) + }) + + test('wet feeling and egg white texture', function () { + const nfpValue = getNfpMucus(2, 2) + expect(nfpValue).toEqual(4) + }) + + test('slippery feeling and egg white texture', function () { + const nfpValue = getNfpMucus(3, 2) + expect(nfpValue).toEqual(4) + }) + + test('slippery feeling and creamy texture', function () { + const nfpValue = getNfpMucus(3, 1) + expect(nfpValue).toEqual(4) + }) + + test('slippery feeling and no texture', function () { + const nfpValue = getNfpMucus(3, 0) + expect(nfpValue).toEqual(4) + }) + }) +}) diff --git a/test/sensiplan-mucus.spec.js b/test/sensiplan-mucus.spec.js deleted file mode 100644 index 9073e26..0000000 --- a/test/sensiplan-mucus.spec.js +++ /dev/null @@ -1,79 +0,0 @@ -import getSensiplanMucus from '../lib/nfp-mucus' - -describe('getSensiplanMucus', () => { - test('returns null if there is no value for feeling or texture', () => { - expect(getSensiplanMucus()).toBeNull() - expect(getSensiplanMucus(undefined, 3)).toBeNull() - expect(getSensiplanMucus(2, undefined)).toBeNull() - }) - - describe('results in t for:', () => { - test('dry feeling and no texture', function () { - const sensiplanValue = getSensiplanMucus(0, 0) - expect(sensiplanValue).toEqual(0) - }) - }) - - describe('results in Ø for:', () => { - test('no feeling and no texture', function () { - const sensiplanValue = getSensiplanMucus(1, 0) - expect(sensiplanValue).toEqual(1) - }) - }) - - describe('results in f for:', () => { - test('wet feeling and no texture', function () { - const sensiplanValue = getSensiplanMucus(2, 0) - expect(sensiplanValue).toEqual(2) - }) - }) - - describe('results in S for:', () => { - test('dry feeling and creamy texture', function () { - const sensiplanValue = getSensiplanMucus(0, 1) - expect(sensiplanValue).toEqual(3) - }) - - test('no feeling and creamy texture', function () { - const sensiplanValue = getSensiplanMucus(1, 1) - expect(sensiplanValue).toEqual(3) - }) - - test('wet feeling and creamy texture', function () { - const sensiplanValue = getSensiplanMucus(2, 1) - expect(sensiplanValue).toEqual(3) - }) - }) - - describe('results in +S for:', () => { - test('dry feeling and egg white texture', function () { - const sensiplanValue = getSensiplanMucus(0, 2) - expect(sensiplanValue).toEqual(4) - }) - - test('no feeling and egg white texture', function () { - const sensiplanValue = getSensiplanMucus(1, 2) - expect(sensiplanValue).toEqual(4) - }) - - test('wet feeling and egg white texture', function () { - const sensiplanValue = getSensiplanMucus(2, 2) - expect(sensiplanValue).toEqual(4) - }) - - test('slippery feeling and egg white texture', function () { - const sensiplanValue = getSensiplanMucus(3, 2) - expect(sensiplanValue).toEqual(4) - }) - - test('slippery feeling and creamy texture', function () { - const sensiplanValue = getSensiplanMucus(3, 1) - expect(sensiplanValue).toEqual(4) - }) - - test('slippery feeling and no texture', function () { - const sensiplanValue = getSensiplanMucus(3, 0) - expect(sensiplanValue).toEqual(4) - }) - }) -})