Skip to content
This repository has been archived by the owner on May 31, 2023. It is now read-only.

Commit

Permalink
Fixed test
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Sefton committed Dec 5, 2019
1 parent 94e6dbe commit 1723df5
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions lib/crate.js
Expand Up @@ -345,6 +345,7 @@ const defaults = require('./defaults');
const _ = require("lodash");



const display_keys = [
"@id",
"name",
Expand Down Expand Up @@ -475,6 +476,7 @@ class Preview {
} else if (path.match(/^https?:\/\//i)) {
view = "Go to: ";
}
console.log("VIEW", view)
if (view){
idLink.append($("<a>").attr("href", path).html(view + path))
}
Expand Down
3 changes: 2 additions & 1 deletion lib/ro-crate-preview-wrapper.js
@@ -1,6 +1,7 @@
// Load a wrapper for use off line

$ = require('cheerio');
const Preview = require("./ro-crate-preview.js");
window = {location: {href: ""}};

const Preview = require("./ro-crate-preview.js");
module.exports = Preview;
2 changes: 2 additions & 0 deletions lib/ro-crate-preview.js
Expand Up @@ -21,6 +21,7 @@ const defaults = require('./defaults');
const _ = require("lodash");



const display_keys = [
"@id",
"name",
Expand Down Expand Up @@ -151,6 +152,7 @@ class Preview {
} else if (path.match(/^https?:\/\//i)) {
view = "Go to: ";
}
console.log("VIEW", view)
if (view){
idLink.append($("<a>").attr("href", path).html(view + path))
}
Expand Down
2 changes: 1 addition & 1 deletion test/ro-crate-preview_spec.js
Expand Up @@ -32,7 +32,7 @@ describe('single item rendering', function () {
const crate = new ROCrate(json);
const preview = new Preview(crate);
const table = await preview.renderMetadataForItem(preview.rootId);
assert.equal(table.find("tr").length, 15, "Has the right number of rows");
assert.equal(table.find("tr").length, 16, "Has the right number of rows");
});
});

Expand Down

0 comments on commit 1723df5

Please sign in to comment.