Created
June 27, 2016 23:34
-
-
Save alecklandgraf/c78caca874ebc086e4d454bdc6c250e5 to your computer and use it in GitHub Desktop.
hello component test compile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| describe("hello nav", function(){ | |
| // globals set up and used in each test scenario | |
| var scope, element; | |
| beforeEach(module('app')); | |
| beforeEach(inject(function($rootScope, $compile) { | |
| scope = $rootScope.$new(); | |
| element = angular.element('<hello-nav me="me"></hello-nav>'); | |
| element = $compile(element)(scope); | |
| scope.me = {first_name: 'Aleck', last_name: 'Landgraf'}; | |
| scope.$apply(); | |
| })); | |
| it('should render Hello and the me.first_name and me.last_name', function () { | |
| var divs = element.find('div'); | |
| var outer_div = divs[0]; | |
| var header = element.find('h2'); | |
| expect(outer_div.className).toBe('section-nav'); | |
| expect(header[0].text).toBe('Hello Aleck Landgraf'); | |
| }); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment