Skip to content

Commit 110caab

Browse files
committed
Adds tests to verify selected results are hidden/show when approprite
1 parent a7d9837 commit 110caab

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

test/filters/filter.spec.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,4 +159,20 @@ describe('Directive: pfFilter', function () {
159159
expect(activeFilters.length).toBe(0);
160160
expect(clearButtons.length).toBe(0);
161161
});
162-
})
162+
163+
it('should not show selected results when selectedCount and totalCount are undefined', function() {
164+
$scope.filterConfig.selectedCount = undefined;
165+
$scope.filterConfig.totalCount = undefined;
166+
$scope.$digest();
167+
168+
expect(element.find('.pf-table-view-selected-label').length).toBe(0);
169+
});
170+
171+
it('should show selected results and totalCount are defined', function() {
172+
$scope.filterConfig.selectedCount = 0;
173+
$scope.filterConfig.totalCount = 10;
174+
$scope.$digest();
175+
176+
expect(element.find('.pf-table-view-selected-label').text()).toContain('0 of 10 selected');
177+
});
178+
});

0 commit comments

Comments
 (0)