Skip to content

Commit

Permalink
update test case for basic content checks
Browse files Browse the repository at this point in the history
  • Loading branch information
thescientist13 committed Aug 3, 2024
1 parent a03c8dc commit cd1e9b4
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions packages/init/test/cases/init.default/init.default.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ describe('Scaffold Greenwood With Default Template: ', function() {

before(async function() {
await fs.promises.mkdir(outputPath);

runner.setup(outputPath);
runner.runCommand(initPath);
});
Expand Down Expand Up @@ -88,11 +89,27 @@ describe('Scaffold Greenwood With Default Template: ', function() {
});
});

describe('initial page contents', function() {
it('should have the correct contents for src/pages.index.md', function() {
const pageContents = fs.readFileSync(path.join(outputPath, 'src/pages/index.md'), 'utf-8');
describe('home page contents', function() {
let pageContents;

before(async function() {
pageContents = fs.readFileSync(path.join(outputPath, 'src/pages/index.html'), 'utf-8');
});

it('should have the expected getting started prompt', function() {
expect(pageContents).to.contain('<h1>Edit <code>src/pages/index.html</code> to start making changes</h1>');
});

it('should have the card headings for src/pages/index.html', function() {
expect(pageContents).to.contain('<h2>Getting Started</h2>');
expect(pageContents).to.contain('<h2>Docs</h2>');
expect(pageContents).to.contain('<h2>Guides</h2>');
expect(pageContents).to.contain('<h2>Community</h2>');
});

expect(pageContents).to.equal('## My Project');
it('should have a <script> tag to the logo component', function() {
expect(pageContents).to.contain('<script type="module" src="../components/logo/logo.js"></script>');
expect(pageContents).to.contain('<x-logo></x-logo>');
});
});
});
Expand Down

0 comments on commit cd1e9b4

Please sign in to comment.