Skip to content
This repository has been archived by the owner on Apr 1, 2019. It is now read-only.

Commit

Permalink
Add test for TileUtils.
Browse files Browse the repository at this point in the history
  • Loading branch information
Marina Samuel committed Jan 28, 2016
1 parent 09dc6ba commit 5ea585a
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/lib/TileUtils.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
/* jshint node:true, esnext:true */

const TileUtils = require("lib/TileUtils");
const assert = require("chai").assert;

describe("TileUtils", function() {
"use strict";

var firstLink = {url: "http://example0.com/", title: "site#0", frecency: 1, lastVisitDate: 1};
var secondLink = {url: "http://example1.com/", title: "site#1", frecency: 3, lastVisitDate: 1};
var thirdLink = {url: "http://example2.com/", title: "site#2", frecency: 3, lastVisitDate: 1};

it("should merge links", () => {
var merged = JSON.stringify(TileUtils.getMergedLinks([[firstLink, thirdLink], [secondLink]]));
assert.equal(merged, JSON.stringify([secondLink, thirdLink, firstLink]));
});

});

0 comments on commit 5ea585a

Please sign in to comment.