Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Commit 8bcf316

Browse files
author
vikasrohit
committed
Merge pull request #667 from appirio-tech/techdebt/unittests-for-directives
Fixed error in running badges-tooltip and toggle-password directives unit tests.
2 parents b329d47 + 35d91d7 commit 8bcf316

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

app/directives/badges/badge-tooltip.spec.js

+15-2
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ describe('Badge Tooltip Directive', function() {
66
var spotlightChallenge = mockData.getMockSpotlightChallenges()[0];
77

88
beforeEach(function() {
9-
bard.appModule('tcUIComponents');
9+
bard.appModule('topcoder');
1010
bard.inject(this, '$compile', '$rootScope');
1111
scope = $rootScope.$new();
1212
});
1313

1414
bard.verifyNoOutstandingHttpRequests();
1515

16-
xdescribe('Badge Tooltip', function() {
16+
describe('Badge Tooltip', function() {
1717
var tooltip;
1818

1919
beforeEach(function() {
@@ -89,5 +89,18 @@ describe('Badge Tooltip Directive', function() {
8989
expect(dataDiv).not.to.null;
9090
expect(dataDiv.hasClass('ng-hide')).to.equal(true);
9191
});
92+
93+
it('should trigger mouseenter handler ', function() {
94+
tooltip.trigger('mouseenter');
95+
var tooltipElement = tooltip.children(0);
96+
expect(tooltipElement.css('z-index')).to.equal('2000');
97+
expect(tooltip.isolateScope().hide).to.equal(false);
98+
});
99+
100+
it('should trigger mouseleave handler ', function() {
101+
tooltip.trigger('mouseleave');
102+
tooltipElement = tooltip.children(0);
103+
expect(tooltip.isolateScope().hide).to.equal(true);
104+
});
92105
});
93106
});

0 commit comments

Comments
 (0)