Skip to content

Commit 75138e7

Browse files
committed
Updated list and card view unit tests
1 parent ba0216e commit 75138e7

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

test/views/cardview/card-view.spec.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ describe('Component: pfCardView', function () {
55

66
// load the controller's module
77
beforeEach(function () {
8-
module('patternfly.views', 'patternfly.utils', 'views/cardview/card-view.html');
8+
module('patternfly.views', 'patternfly.utils', 'views/cardview/card-view.html', 'views/empty-state.html');
99
});
1010

1111
beforeEach(inject(function (_$compile_, _$rootScope_) {
@@ -220,4 +220,10 @@ describe('Component: pfCardView', function () {
220220
}
221221
expect(exceptionRaised).toBe(true);
222222
});
223+
224+
it('should show the empty state when specified', function () {
225+
$scope.cardConfig.itemsAvailable = false;
226+
$scope.$digest();
227+
expect(element.find('#title').text()).toContain('No Items Available');
228+
});
223229
})

test/views/listview/list-view.spec.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ describe('Component: pfDataList', function () {
77

88
// load the controller's module
99
beforeEach(function () {
10-
module('patternfly.views', 'patternfly.utils', 'views/listview/list-view.html');
10+
module('patternfly.views', 'patternfly.utils', 'views/listview/list-view.html', 'views/empty-state.html');
1111
});
1212

1313
beforeEach(inject(function (_$compile_, _$rootScope_, _$timeout_) {
@@ -541,4 +541,10 @@ describe('Component: pfDataList', function () {
541541
items = element.find('.list-view-pf-expand .fa-angle-right.ng-hide');
542542
expect(items.length).toBe(1);
543543
});
544+
545+
it('should show the empty state when specified', function () {
546+
$scope.listConfig.itemsAvailable = false;
547+
$scope.$digest();
548+
expect(element.find('#title').text()).toContain('No Items Available');
549+
});
544550
});

0 commit comments

Comments
 (0)