Add acceptance tests for custom-html

This commit is contained in:
Robin Ward
2016-11-23 12:57:50 -05:00
parent 79dc0518c9
commit ae4fd06444
6 changed files with 61 additions and 24 deletions

View File

@@ -1,7 +1,7 @@
import { registerHelper } from 'discourse-common/lib/helpers';
import PreloadStore from 'preload-store';
const _customizations = {};
let _customizations = {};
export function getCustomHTML(key) {
const c = _customizations[key];
@@ -15,6 +15,10 @@ export function getCustomHTML(key) {
}
}
export function clearHTMLCache() {
_customizations = {};
}
// Set a fragment of HTML by key. It can then be looked up with `getCustomHTML(key)`.
export function setCustomHTML(key, html) {
_customizations[key] = html;