Skip to content

Commit bba94f8

Browse files
Updated test to match fixture instead of Regex
1 parent 079974a commit bba94f8

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

test/unit/models/profileDiffs.test.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
/**
2-
* This eslint rule is disabled because of https://github.com/nodesecurity/eslint-plugin-security/issues/21
3-
* It gives linting errors in testing the DB data with keys from fixtures
4-
*/
5-
/* eslint-disable security/detect-object-injection */
6-
71
const chai = require("chai");
82
const { expect } = chai;
93
const cleanDb = require("../../utils/cleanDb");
@@ -36,8 +30,8 @@ describe("profileDiffs", function () {
3630
const profileDiffs = getProfileDiffs();
3731
const profileDiffId = await profileDiffsQuery.add(profileDiffs[0]);
3832
const diff = await profileDiffsQuery.fetchProfileDiffUnobfuscated(profileDiffId);
39-
expect(diff.phone).to.match(/^(\+\d{1,3}[- ]?)?\d{7,10}$/);
40-
expect(diff.email).to.match(/^([A-Z0-9+-]{1,20}(.[A-Z0-9+-]{1,20})*)@[A-Z0-9][A-Z0-9-](.[A-Z]{2,})+$/i);
33+
expect(diff.phone).to.equal(profileDiffs[0].phone);
34+
expect(diff.email).to.equal(profileDiffs[0].email);
4135
});
4236
});
4337
});

0 commit comments

Comments
 (0)