Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

Allow for multiple classes #1842

Closed
wants to merge 29 commits into from
Closed

Conversation

HJain01
Copy link

@HJain01 HJain01 commented Jul 19, 2018

This allows for multiple classes to be input into sky-icon

@blackbaud-sky-savage
Copy link
Collaborator

Tests failed. Automated cross-browser testing via BrowserStack and Travis CI shows that the JavaScript changes in this pull request are: BUSTED

Commit: cdecb5a
Build details: https://travis-ci.org/blackbaud-sky-savage/skyux2/builds/405830355

(Please note that this is a fully automated comment.)

@blackbaud-sky-savage
Copy link
Collaborator

Tests failed. Automated cross-browser testing via BrowserStack and Travis CI shows that the JavaScript changes in this pull request are: BUSTED

Commit: 55fde1a
Build details: https://travis-ci.org/blackbaud-sky-savage/skyux2/builds/405840078

(Please note that this is a fully automated comment.)

@blackbaud-sky-savage
Copy link
Collaborator

Tests failed. Automated cross-browser testing via BrowserStack and Travis CI shows that the JavaScript changes in this pull request are: BUSTED

Commit: f7a497f
Build details: https://travis-ci.org/blackbaud-sky-savage/skyux2/builds/405913126

(Please note that this is a fully automated comment.)

@blackbaud-sky-savage
Copy link
Collaborator

Tests passed. Automated cross-browser testing via BrowserStack and Travis CI shows that the JavaScript changes in this pull request are: CONFIRMED

Commit: 1f2b52f
Build details: https://travis-ci.org/blackbaud-sky-savage/skyux2/builds/405931993

(Please note that this is a fully automated comment.)

@codecov-io
Copy link

codecov-io commented Jul 19, 2018

Codecov Report

Merging #1842 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1842      +/-   ##
==========================================
+ Coverage   99.98%   99.98%   +<.01%     
==========================================
  Files         410      412       +2     
  Lines        8592     8610      +18     
  Branches     1269     1271       +2     
==========================================
+ Hits         8591     8609      +18     
  Misses          1        1
Impacted Files Coverage Δ
src/modules/icon/icon.component.ts 100% <100%> (ø)
src/modules/icon/icon.module.ts 100% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ab24902...39ed79c. Read the comment docs.

@blackbaud-sky-savage
Copy link
Collaborator

Tests passed. Automated cross-browser testing via BrowserStack and Travis CI shows that the JavaScript changes in this pull request are: CONFIRMED

Commit: 257b8e4
Build details: https://travis-ci.org/blackbaud-sky-savage/skyux2/builds/405948527

(Please note that this is a fully automated comment.)

@blackbaud-sky-savage
Copy link
Collaborator

Tests failed. Automated cross-browser testing via BrowserStack and Travis CI shows that the JavaScript changes in this pull request are: BUSTED

Commit: 7ea881c
Build details: https://travis-ci.org/blackbaud-sky-savage/skyux2/builds/405948616

(Please note that this is a fully automated comment.)

@@ -0,0 +1,12 @@
<div id="screenshot-icon">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style comment:
attributes go on their own lines for all html tags.

@@ -0,0 +1,10 @@
<sky-icon icon="spinner" size="3x" fixedWidth="true"></sky-icon>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

attributes on different lines in alphabetical order

@@ -0,0 +1 @@
<sky-icon [icon]="icon" [size]="size" [fixedWidth]="fixedWidth"></sky-icon>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

attributes on different lines in alphabetical order

@@ -0,0 +1,5 @@
<i *ngIf="icon"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move *ngIf to its own line

expect(element.querySelector('.sky-icon').classList.length).toBe(4);
});

it('should display something other than circle', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rename this to say that it is testing that an icon is displayed with a fixed width and no size


it('should display something other than circle', () => {
cmp.icon = 'broom';
cmp.size = '';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use undefined instead of empty string to represent the value not being provided

public size: string;

@Input()
public fixedWidth: boolean = true;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want this to default to false?

if (this.size !== '') {
list.push('fa-' + this.size);
}
if (this.fixedWidth === true) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since fixedWidth is a boolean, this could just be
if (this.fixedWidth) {

public classList(): string[] {
let list: string[] = [];
list.push('fa-' + this.icon);
if (this.size !== '') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In javascript all values are truthy or falsy and in this case we will want to cover the scenarios where size is undefined or ''
Both of those are considered falsy. So this can be:
if (this.size) {

and it will cover both cases

Copy link
Contributor

@blackbaud-conorwright blackbaud-conorwright left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just two small things

@@ -15,7 +15,7 @@ import {
expect
} from '@blackbaud/skyux-builder/runtime/testing/browser';

describe('Icon component', () => {
fdescribe('Icon component', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missed an "f" 😉

<sky-icon
[icon]="icon"
[size]="size"
[fixedWidth]="fixedWidth">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alphabetical
<sky-icon
[fixedWidth]="fixedWidth"
[icon]="icon"
[size]="size">

@blackbaud-sky-savage
Copy link
Collaborator

Tests failed. Automated cross-browser testing via BrowserStack and Travis CI shows that the JavaScript changes in this pull request are: BUSTED

Commit: da17078
Build details: https://travis-ci.org/blackbaud-sky-savage/skyux2/builds/405976464

(Please note that this is a fully automated comment.)

Copy link
Contributor

@blackbaud-conorwright blackbaud-conorwright left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, Harsh! 😃

@blackbaud-sky-savage
Copy link
Collaborator

Tests failed. Automated cross-browser testing via BrowserStack and Travis CI shows that the JavaScript changes in this pull request are: BUSTED

Commit: 2fbcc76
Build details: https://travis-ci.org/blackbaud-sky-savage/skyux2/builds/406216342

(Please note that this is a fully automated comment.)

@blackbaud-sky-savage
Copy link
Collaborator

Tests passed. Automated cross-browser testing via BrowserStack and Travis CI shows that the JavaScript changes in this pull request are: CONFIRMED

Commit: 39ed79c
Build details: https://travis-ci.org/blackbaud-sky-savage/skyux2/builds/406218012

(Please note that this is a fully automated comment.)

This was referenced Jul 20, 2018
@blackbaud-conorwright
Copy link
Contributor

closing in favor of #1846
Thank you for contributing!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants