From f6fd9ea8957a9a3e8e745c74bde1d3d9b5ea2e37 Mon Sep 17 00:00:00 2001 From: Owen Buckley Date: Wed, 7 Aug 2019 20:58:11 -0400 Subject: [PATCH] test for styles in getting started case --- ....default.workspace-getting-started.spec.js | 30 +++++++++++++++++-- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/test/cli/cases/build.default.workspace-getting-started/build.default.workspace-getting-started.spec.js b/test/cli/cases/build.default.workspace-getting-started/build.default.workspace-getting-started.spec.js index 01784ac4c..c20ec265f 100644 --- a/test/cli/cases/build.default.workspace-getting-started/build.default.workspace-getting-started.spec.js +++ b/test/cli/cases/build.default.workspace-getting-started/build.default.workspace-getting-started.spec.js @@ -35,7 +35,7 @@ const path = require('path'); const TestBed = require('../../test-bed'); describe('Build Greenwood With: ', function() { - const LABEL = 'Custom Workspace based on the Getting Started guide'; + const LABEL = 'Custom Workspace based on the Getting Started guide and repo'; let setup; before(async function() { @@ -89,7 +89,19 @@ describe('Build Greenwood With: ', function() { expect(footer.length).to.be.equal(1); }); - // TODO global styles + it('should have the expected font import', async function() { + const styles = '@import url(//fonts.googleapis.com/css?family=Source+Sans+Pro&display=swap);'; + const styleTags = dom.window.document.querySelectorAll('head style'); + let importCount = 0; + + styleTags.forEach((tag) => { + if (tag.textContent.indexOf(styles) >= 0) { + importCount += 1; + } + }); + + expect(importCount).to.equal(1); + }); }); describe('Blog Posts', function() { @@ -123,7 +135,19 @@ describe('Build Greenwood With: ', function() { expect(footer.length).to.be.equal(1); }); - // TODO global styles + it('should have the expected font import', async function() { + const styles = '@import url(//fonts.googleapis.com/css?family=Source+Sans+Pro&display=swap);'; + const styleTags = dom.window.document.querySelectorAll('head style'); + let importCount = 0; + + styleTags.forEach((tag) => { + if (tag.textContent.indexOf(styles) >= 0) { + importCount += 1; + } + }); + + expect(importCount).to.equal(1); + }); }); });