@@ -27,6 +27,7 @@ import { JSDOM } from "jsdom";
2727import path from "node:path" ;
2828import chai from "chai" ;
2929import { getOutputTeardownFiles } from "../../../../../test/utils.js" ;
30+ import { runSmokeTest } from "../../../../../test/smoke-test.js" ;
3031import { Runner } from "gallinago" ;
3132import { fileURLToPath } from "node:url" ;
3233
@@ -51,6 +52,8 @@ describe("Build Greenwood With: ", function () {
5152 runner . runCommand ( cliPath , "build" ) ;
5253 } ) ;
5354
55+ runSmokeTest ( [ "public" , "index" ] , LABEL ) ;
56+
5457 describe ( "Default Greenwood frontmatter should be interpolated in the correct places for the home page" , function ( ) {
5558 let dom ;
5659
@@ -83,7 +86,7 @@ describe("Build Greenwood With: ", function () {
8386 } ) ;
8487 } ) ;
8588
86- describe ( "Simple frontmatter should be interpolated in the correct places" , function ( ) {
89+ describe ( "Simple active frontmatter should be interpolated in the correct places for the first blog post page " , function ( ) {
8790 let dom ;
8891
8992 before ( async function ( ) {
@@ -95,7 +98,7 @@ describe("Build Greenwood With: ", function () {
9598 it ( "should have the correct value for the <title> tag in the <head> for the first post page" , function ( ) {
9699 const title = dom . window . document . querySelector ( "head title" ) . textContent ;
97100
98- expect ( title ) . to . be . equal ( "My First Post" ) ;
101+ expect ( title ) . to . be . equal ( "My Blog - My First Post" ) ;
99102 } ) ;
100103
101104 it ( "should have the correct value for author <meta> tag in the <head>" , function ( ) {
@@ -119,7 +122,7 @@ describe("Build Greenwood With: ", function () {
119122 } ) ;
120123 } ) ;
121124
122- describe ( "Rich frontmatter should be interpolated in the correct places" , function ( ) {
125+ describe ( "Rich active frontmatter should be interpolated in the correct places for the second blog post page " , function ( ) {
123126 let dom ;
124127
125128 before ( async function ( ) {
@@ -131,7 +134,7 @@ describe("Build Greenwood With: ", function () {
131134 it ( "should have the correct value for the <title> tag in the <head> for second post page" , function ( ) {
132135 const title = dom . window . document . querySelector ( "head title" ) . textContent ;
133136
134- expect ( title ) . to . be . equal ( "My Second Post" ) ;
137+ expect ( title ) . to . be . equal ( "My Blog - My Second Post" ) ;
135138 } ) ;
136139
137140 it ( "should have the correct songs frontmatter data in the page output" , function ( ) {
@@ -148,6 +151,26 @@ describe("Build Greenwood With: ", function () {
148151 } ) ;
149152 } ) ;
150153 } ) ;
154+
155+ describe ( "Page level custom title for the about page" , function ( ) {
156+ let dom ;
157+
158+ before ( async function ( ) {
159+ dom = await JSDOM . fromFile ( path . resolve ( this . context . publicDir , "./about/index.html" ) ) ;
160+ } ) ;
161+
162+ it ( "should have the correct value for the <title> tag in the <head>" , function ( ) {
163+ const title = dom . window . document . querySelector ( "head title" ) . textContent ;
164+
165+ expect ( title ) . to . be . equal ( "My Custom About Page Title" ) ;
166+ } ) ;
167+
168+ it ( "should have the correct content for the page" , function ( ) {
169+ const heading = dom . window . document . querySelector ( "body h1" ) . textContent ;
170+
171+ expect ( heading ) . to . be . equal ( "This is the about page" ) ;
172+ } ) ;
173+ } ) ;
151174 } ) ;
152175
153176 after ( function ( ) {
0 commit comments