Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes issue 575: change h1 to h4 styled as h1 #587

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/views/empty-state.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
<div ng-if="$ctrl.config.icon" class="blank-slate-pf-icon">
<span class="{{$ctrl.config.icon}}"></span>
</div>
<h1 id="title">
<h4 id="blank-state-pf-title-{{$id}}" class="h1 blank-state-pf-title">
{{$ctrl.config.title}}
</h1>
<p id="info" ng-if="$ctrl.config.info">
</h4>
<p id="blank-state-pf-info-{{$id}}" class="blank-state-pf-info" ng-if="$ctrl.config.info">
{{$ctrl.config.info}}
</p>
<p id="helpLink" ng-if="$ctrl.config.helpLink">
<p id="blank-state-pf-helpLink-{{$id}}" class="blank-state-pf-helpLink" ng-if="$ctrl.config.helpLink">
{{$ctrl.config.helpLink.label}} <a href="{{$ctrl.config.helpLink.url}}">{{$ctrl.config.helpLink.urlLabel}}</a>.
</p>
<div ng-if="$ctrl.hasMainActions()" class="blank-slate-pf-main-action">
Expand Down
8 changes: 4 additions & 4 deletions test/notification/notification-drawer.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ describe('Component: pfNotificationDrawer', function () {
var emptyStates = element.find('.blank-slate-pf');
expect(emptyStates.length).toBe(1);

var title = angular.element(emptyStates[0]).find('#title').html();
var title = angular.element(emptyStates[0]).find('.blank-state-pf-title').html();
expect(_.trim(title)).toBe('There are no notifications to display.');
});

Expand All @@ -609,18 +609,18 @@ describe('Component: pfNotificationDrawer', function () {
var emptyStates = element.find('.blank-slate-pf');
expect(emptyStates.length).toBe(1);

var title = angular.element(emptyStates[0]).find('#title').html();
var title = angular.element(emptyStates[0]).find('.blank-state-pf-title').html();
expect(_.trim(title)).toBe('Nothing');
});

it ('should show the empty state pattern when no notifications exist for a group', function() {
var emptyStates = element.find('.blank-slate-pf');
expect(emptyStates.length).toBe(2);

var title = angular.element(emptyStates[0]).find('#title').html();
var title = angular.element(emptyStates[0]).find('.blank-state-pf-title').html();
expect(_.trim(title)).toBe('There are no notifications to display.');

title = angular.element(emptyStates[1]).find('#title').html();
title = angular.element(emptyStates[1]).find('.blank-state-pf-title').html();
expect(_.trim(title)).toBe('Nothing');
});
});
6 changes: 3 additions & 3 deletions test/table/tableview/table-view.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,21 +85,21 @@ describe('Component: pfTableView', function () {
basicSetup();
$scope.items = null;
$scope.$digest();
expect(element.find('#title').text()).toContain('');
expect(element.find('.blank-state-pf-title').text()).toContain('');
});

it('should show the empty state when items is empty', function () {
basicSetup();
$scope.items = [];
$scope.$digest();
expect(element.find('#title').text()).toContain('No Items Available');
expect(element.find('.blank-state-pf-title').text()).toContain('No Items Available');
});

it('should show the empty state when the config property is specified', function () {
basicSetup();
$scope.config.itemsAvailable = false;
$scope.$digest();
expect(element.find('#title').text()).toContain('No Items Available');
expect(element.find('.blank-state-pf-title').text()).toContain('No Items Available');
});

it('should show the correct number of items', function () {
Expand Down
2 changes: 1 addition & 1 deletion test/views/cardview/card-view.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,6 @@ describe('Component: pfCardView', function () {
it('should show the empty state when specified', function () {
$scope.cardConfig.itemsAvailable = false;
$scope.$digest();
expect(element.find('#title').text()).toContain('No Items Available');
expect(element.find('.blank-state-pf-title').text()).toContain('No Items Available');
});
})
14 changes: 7 additions & 7 deletions test/views/empty-state.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
describe('Component: pfEnptyState', function () {
describe('Component: pfEmptyState', function () {
var $scope;
var $compile;
var element;
Expand Down Expand Up @@ -68,9 +68,9 @@ describe('Component: pfEnptyState', function () {
compileHTML('<pf-empty-state config="config" action-buttons="actionButtons"></pf-empty-state>', $scope);

expect(element.find('.pficon-add-circle-o').length).toBe(1);
expect(element.find('#title').text()).toContain('Empty State Title');
expect(element.find('#info').text()).toContain('This is the Empty State component');
expect(element.find('#helpLink').text()).toContain('For more information please see');
expect(element.find('.blank-state-pf-title').text()).toContain('Empty State Title');
expect(element.find('.blank-state-pf-info').text()).toContain('This is the Empty State component');
expect(element.find('.blank-state-pf-helpLink').text()).toContain('For more information please see');
expect(element.find('a').text()).toContain('pfExample');
expect(element.find('a').prop('href')).toContain('#/api/patternfly.views.component:pfEmptyState');

Expand All @@ -89,11 +89,11 @@ describe('Component: pfEnptyState', function () {
it('should only display main default title when no config and actionButtons defined', function () {
compileHTML('<pf-empty-state></pf-empty-state>', $scope);

expect(element.find('#title').text()).toContain('No Items Available');
expect(element.find('.blank-state-pf-title').text()).toContain('No Items Available');

expect(element.find('.blank-slate-pf-icon').length).toBe(0);
expect(element.find('#info').length).toBe(0);
expect(element.find('#helpLink').length).toBe(0);
expect(element.find('.info').length).toBe(0);
expect(element.find('.helpLink').length).toBe(0);
expect(element.find('button').length).toBe(0);
});
});
2 changes: 1 addition & 1 deletion test/views/listview/list-view.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,6 @@ describe('Component: pfDataList', function () {
it('should show the empty state when specified', function () {
$scope.listConfig.itemsAvailable = false;
$scope.$digest();
expect(element.find('#title').text()).toContain('No Items Available');
expect(element.find('.blank-state-pf-title').text()).toContain('No Items Available');
});
});