@kano/web-components
Version:
Shared web-components for the Kano ecosystem.
51 lines (42 loc) • 1.51 kB
HTML
<html>
<head>
<meta charset="UTF-8">
<title>kw-project-card test</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<script src="../../../../@webcomponents/webcomponentsjs/webcomponents-bundle.js"></script>
<script src="../../../../wct-browser-legacy/browser.js"></script>
<script type="module" src="../kano-project-card.js"></script>
</head>
<body>
<test-fixture id="default">
<template>
<kw-project-card></kw-project-card>
</template>
</test-fixture>
<script type="module">
import '../kano-project-card.js';
suite('<kw-project-card>', function() {
var card;
setup(function() {
card = fixture('default');
card.project = {
title: "I am not really\nsecu\nre <a href='http://dodgy.website.com'></a>",
image: "/assets/projects/icons/light/pixel_1.png",
link: "https://apps.kano.me/story/pixel_1",
slug: "pixel_1",
creator: "kevinmurphy",
completed: false
}
});
test('check heading security', function() {
var headingEl = card.$$('.title');
assert.equal(headingEl.innerHTML.indexOf('</a>'), -1);
});
test('check line return translation', function() {
var headingEl = card.$$('.title');
assert.notEqual(headingEl.innerHTML.indexOf('<br>'), -1);
});
});
</script>
</body>
</html>