Skip to content

Instantly share code, notes, and snippets.

@PitBeast
Last active August 29, 2015 14:05
Show Gist options
  • Select an option

  • Save PitBeast/c3df13c26f5cfd04bafd to your computer and use it in GitHub Desktop.

Select an option

Save PitBeast/c3df13c26f5cfd04bafd to your computer and use it in GitHub Desktop.
describe('statsHeight', function() {
var $compile,
$rootScope,
$timeout;
beforeEach(inject(function (_$compile_, _$rootScope_, _$timeout_){
$compile = _$compile_;
$rootScope = _$rootScope_;
$timeout = _$timeout_;
}));
it('string length less than 4', function() {
var element = $compile('<dt stats-height="\'93\'" class="\'list_item_description__number\'" ng-bind="\'999\'"></dt>')($rootScope);
$rootScope.$digest();
$timeout.flush()
expect(element.html().length).toBeLessThan(4);
expect(element.css("font-size")).toEqual("93px");
});
it('string length greater than 4', function() {
var element = $compile('<dt stats-height="\'93\'" class="\'list_item_description__number\'" ng-bind="\'999569\'"></dt>')($rootScope);
$rootScope.$digest();
$timeout.flush()
expect(element.html().length).toBeGreaterThan(4);
expect(element.css("font-size")).toEqual("63px");
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment