From 082baa86138217b5df771c7c4fbde48a549c748e Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Wed, 31 Oct 2018 20:00:32 +0200 Subject: [PATCH] Add tests for 2 browser snippets --- test/createElement.test.js | 7 +++++++ test/currentURL.test.js | 3 +++ 2 files changed, 10 insertions(+) diff --git a/test/createElement.test.js b/test/createElement.test.js index 8c253138f..66c7c0f1c 100644 --- a/test/createElement.test.js +++ b/test/createElement.test.js @@ -4,3 +4,10 @@ const {createElement} = require('./_30s.js'); test('createElement is a Function', () => { expect(createElement).toBeInstanceOf(Function); }); +test('createElement creates an element', () => { + expect(createElement( + `
+

Hello!

+
` + ).className).toEqual('container'); +}); diff --git a/test/currentURL.test.js b/test/currentURL.test.js index 8aa22f088..8e7869047 100644 --- a/test/currentURL.test.js +++ b/test/currentURL.test.js @@ -4,3 +4,6 @@ const {currentURL} = require('./_30s.js'); test('currentURL is a Function', () => { expect(currentURL).toBeInstanceOf(Function); }); +test('currentURL returns the appropriate value', () => { + expect(currentURL()).toEqual(global.location.href); +});