All files / ember-web-app/node-tests/blueprints ember-web-app-test.js

93.75% Statements 15/16
100% Branches 0/0
88.89% Functions 8/9
93.75% Lines 15/16

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45  1x             1x   1x 1x   1x 1x 1x   1x 1x 1x               1x 1x   1x 1x               1x          
'use strict';
const { expect } = require('ember-cli-blueprint-test-helpers/chai');
const {
  setupTestHooks,
  emberNew,
  emberGenerate,
  emberGenerateDestroy,
  emberDestroy,
} = require('ember-cli-blueprint-test-helpers/helpers');
 
describe('Blueprints', function() {
  setupTestHooks(this);
 
  describe('ember generate', function() {
    it('generates config/manifest.js file', function() {
      let args = ['ember-web-app', 'foo'];
 
      return emberNew().then(() =>
        emberGenerateDestroy(args, file => {
          expect(file('config/manifest.js'))
            .to.contain('name: "my-app"')
            .to.contain('short_name: "my-app"')
            .to.contain('display: "standalone"');
        })
      );
    });
 
    it('adds manifest link & browserconfig meta into app/index.html file', function() {
      let args = ['ember-web-app', 'foo'];
 
      return emberNew().then(() =>
        emberGenerate(args, file => {
          expect(file('app/index.html'))
            .to.contain(
              '<link rel="manifest" src="{{rootURL}}manifest.webmanifest">'
            )
            .to.contain(
              '<meta name="msapplication-config" content="{{rootURL}}browserconfig.xml">'
            );
        }).then(() => emberDestroy(args))
      );
    });
  });
});