From b5dee798b73fb2acb6a9302192ec7fcf285c4e74 Mon Sep 17 00:00:00 2001 From: rani <rani@drdaccess.com> Date: Thu, 5 Dec 2019 17:09:42 +0700 Subject: [PATCH] add test for Github link validation --- assets/js/__test__/Utils-test.jsx | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 assets/js/__test__/Utils-test.jsx diff --git a/assets/js/__test__/Utils-test.jsx b/assets/js/__test__/Utils-test.jsx new file mode 100644 index 00000000..d1283928 --- /dev/null +++ b/assets/js/__test__/Utils-test.jsx @@ -0,0 +1,17 @@ +import { isFromGithubLinkValid } from "../Utils"; + +var assert = require('assert'); + +describe('isFromGithubLinkValid', function () { + + it('should return nothing when param is null', function () { + assert(isFromGithubLinkValid(null) == null); + }); + it('should return false when link doesnt include https://github.com', function () { + assert(isFromGithubLinkValid("https://haha.com") == false); + }); + it('should return true when link include https://github.com', function () { + assert(isFromGithubLinkValid("https://github.com/ranisianipar") == true); + }); + +}) \ No newline at end of file -- GitLab