Sha256: 1c55981d86d2533a30e179eca1b075fb57ce0e1448f6fa0a80e396c4d1a5b780

Contents?: true

Size: 1.37 KB

Versions: 3

Compression:

Stored size: 1.37 KB

Contents

'use strict';

describe('herald.artifact module', function() {
  beforeEach(module('herald.artifact'));

  describe('app-version directive', function() {

    var $controller, $compile, $rootScope;
    // Store references to $rootScope and $compile
    // so they are available to all tests in this describe block
    beforeEach(inject(function(_$compile_, _$controller_, _$rootScope_){
      // The injector unwraps the underscores (_) from around the parameter names when matching
      $compile = _$compile_;
      $controller = _$controller_;
      $rootScope = _$rootScope_;
    }));

    it('should print current version', function() {

      inject(function($compile, $rootScope, $injector) {
        // Set up the mock http service responses
        var $httpBackend = $injector.get('$httpBackend');
        // backend definition common for all tests
        var authRequestHandler = $httpBackend.when('GET', '/version.json')
                              .respond({version: 'TEST_VER'});
        $httpBackend.expectGET('/version.json');

        var element = $compile('<div><span app-version></span></div>')($rootScope);
        expect(element.text()).toEqual('{{ artifact.version }}');
        // fire all the watches, so the scope expression {{ artifact.version }} will be evaluated
        $rootScope.$digest();
        expect(element.text()).toEqual('0.0.0');
      });
    });
  });
});

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
puppet-herald-0.8.1 test/javascript/src/components/artifact/artifact-directive_test.js
puppet-herald-0.8.0 test/javascript/src/components/artifact/artifact-directive_test.js
puppet-herald-0.2.0 test/javascript/src/components/artifact/artifact-directive_test.js