'use strict'; const assert = require('assert'); const fs = require('fs'); const path = require('path'); function read(relativePath) { const filePath = path.join(__dirname, '..', relativePath); assert(fs.existsSync(filePath), `${relativePath} should exist`); return fs.readFileSync(filePath, 'utf8'); } function assertIncludes(haystack, needle, message) { assert( haystack.includes(needle), message || `Expected file to include ${needle}` ); } function assertExcludes(haystack, needle, message) { assert( !haystack.includes(needle), message || `Expected file not to include ${needle}` ); } const footer = read('templates/footer.tpl'); const theme = read('theme.scss'); const partial = read('templates/partials/footer/westgate-global.tpl'); assertIncludes( footer, '', 'Footer layout should mount the Westgate global footer partial' ); assertExcludes( footer, '', "Footer should not reintroduce Harmony's right global sidebar" ); assertIncludes( theme, '@import "./scss/westgate/footer";', 'theme.scss should import the focused footer partial' ); assertIncludes(partial, '