From 388135d6d2e5f3193bdd295eb1ef1b21b96f2a24 Mon Sep 17 00:00:00 2001 From: Basma Diaz <140777879+bdiaz12@users.noreply.github.com> Date: Fri, 25 Aug 2023 22:50:17 -0500 Subject: [PATCH] Delete substitution.submission.test.js --- test/substitution.submission.test.js | 84 ---------------------------- 1 file changed, 84 deletions(-) delete mode 100644 test/substitution.submission.test.js diff --git a/test/substitution.submission.test.js b/test/substitution.submission.test.js deleted file mode 100644 index 83e3721..0000000 --- a/test/substitution.submission.test.js +++ /dev/null @@ -1,84 +0,0 @@ -const { expect } = require("chai"); -const { substitution } = require("../src/substitution"); - -describe("substitution() submission tests written by Thinkful", () => { - describe("error handling", () => { - it("should return false if the substitution alphabet is missing", () => { - const message = "message"; - const actual = substitution(message); - expect(actual).to.be.false; - }); - - it("should return false if the substitution alphabet is not exactly 26 characters", () => { - const message = "message"; - const alphabet = "short"; - const actual = substitution(message, alphabet); - expect(actual).to.be.false; - }); - - it("should return false if the substitution alphabet does not contain unique characters", () => { - const message = "message"; - const alphabet = "abcabcabcabcabcabcabcabcab"; - const actual = substitution(message, alphabet); - expect(actual).to.be.false; - }); - }); - - describe("encoding a message", () => { - it("should encode a message by using the given substitution alphabet", () => { - const message = "message"; - const alphabet = "plmoknijbuhvygctfxrdzeswaq"; - const actual = substitution(message, alphabet); - const expected = "ykrrpik"; - - expect(actual).to.equal(expected); - }); - - it("should work with any kind of key with unique characters", () => { - const message = "message"; - const alphabet = ".waeszrdxtfcygvuhbijnokmpl"; - const actual = substitution(message, alphabet); - const expected = "ysii.rs"; - - expect(actual).to.equal(expected); - }); - - it("should preserve spaces", () => { - const message = "my message"; - const alphabet = ".waeszrdxtfcygvuhbijnokmpl"; - const actual = substitution(message, alphabet); - const expected = "yp ysii.rs"; - - expect(actual).to.equal(expected); - }); - }); - - describe("decoding a message", () => { - it("should decode a message by using the given substitution alphabet", () => { - const message = "ykrrpik"; - const alphabet = "plmoknijbuhvygctfxrdzeswaq"; - const actual = substitution(message, alphabet, false); - const expected = "message"; - - expect(actual).to.equal(expected); - }); - - it("should work with any kind of key with unique characters", () => { - const message = "ysii.rs"; - const alphabet = ".waeszrdxtfcygvuhbijnokmpl"; - const actual = substitution(message, alphabet, false); - const expected = "message"; - - expect(actual).to.equal(expected); - }); - - it("should preserve spaces", () => { - const message = "yp ysii.rs"; - const alphabet = ".waeszrdxtfcygvuhbijnokmpl"; - const actual = substitution(message, alphabet, false); - const expected = "my message"; - - expect(actual).to.equal(expected); - }); - }); -});