Skip to content

Commit

Permalink
fix: isSpecial
Browse files Browse the repository at this point in the history
  • Loading branch information
singuerinc committed Feb 25, 2019
1 parent 4b681dd commit ef8f9ee
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/isSpecial.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function isSpecial(value) {
return false;
}

if (!SPECIALS[code]) {
if (!SPECIALS[code.toUpperCase()]) {
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion src/specials.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ export const SPECIALS = {
MOP: "Public Works Ministry",
PME: "State owned vehicles",
PMM: "State owned vehicles, on a Ministry",
Crown: "King's Car"
CROWN: "King's Car"
};
8 changes: 8 additions & 0 deletions test/isSpecial.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ describe("#isSpecial", () => {
assert.equal(isSpecial("Crown 0000"), true);
});

it("should be valid with crown", () => {
assert.equal(isSpecial("crown0001"), true);
});

it("should be valid with crown", () => {
assert.equal(isSpecial("crown-0001"), true);
});

it("should be valid with CME", () => {
assert.equal(isSpecial("CME 0001"), true);
});
Expand Down

0 comments on commit ef8f9ee

Please sign in to comment.