Commit 36e5537a authored by Mike Greiling's avatar Mike Greiling Committed by Paul Slaughter

Remove unnecessary attributes from icon.vue

- `cssClasses` is redundant because `class`
  values are merged with the root element anyway.
- `width`, `height`, `x`, `y` are redundant and
  will all pass through.
- `tabIndex` is redundant because `tabindex` can
  be passed through.

https://gitlab.com/gitlab-org/gitlab/merge_requests/17839
parent 38c88bbe
...@@ -34,7 +34,7 @@ export default { ...@@ -34,7 +34,7 @@ export default {
<template> <template>
<span> <span>
<span ref="issueTimeEstimate" class="board-card-info card-number"> <span ref="issueTimeEstimate" class="board-card-info card-number">
<icon name="hourglass" css-classes="board-card-info-icon align-top" /><time <icon name="hourglass" class="board-card-info-icon align-top" /><time
class="board-card-info-text" class="board-card-info-text"
>{{ timeEstimate }}</time >{{ timeEstimate }}</time
> >
......
...@@ -34,7 +34,7 @@ export default { ...@@ -34,7 +34,7 @@ export default {
class="more-actions-toggle btn btn-transparent p-0" class="more-actions-toggle btn btn-transparent p-0"
data-toggle="dropdown" data-toggle="dropdown"
> >
<icon css-classes="icon" name="ellipsis_v" /> <icon class="icon" name="ellipsis_v" />
</gl-button> </gl-button>
<ul class="more-actions-dropdown dropdown-menu dropdown-open-left"> <ul class="more-actions-dropdown dropdown-menu dropdown-open-left">
<slot name="dropdown-options"></slot> <slot name="dropdown-options"></slot>
......
...@@ -100,7 +100,7 @@ export default { ...@@ -100,7 +100,7 @@ export default {
<template slot="lastSeen" slot-scope="errors"> <template slot="lastSeen" slot-scope="errors">
<div class="d-flex align-items-center"> <div class="d-flex align-items-center">
<icon name="calendar" css-classes="text-secondary mr-1" /> <icon name="calendar" class="text-secondary mr-1" />
<time-ago :time="errors.item.lastSeen" class="text-secondary" /> <time-ago :time="errors.item.lastSeen" class="text-secondary" />
</div> </div>
</template> </template>
......
...@@ -56,7 +56,7 @@ export default { ...@@ -56,7 +56,7 @@ export default {
class="leave-group btn btn-xs no-expand" class="leave-group btn btn-xs no-expand"
@click.prevent="onLeaveGroup" @click.prevent="onLeaveGroup"
> >
<icon name="leave" css-classes="position-top-0" /> <icon name="leave" class="position-top-0" />
</a> </a>
<a <a
v-if="group.canEdit" v-if="group.canEdit"
...@@ -68,7 +68,7 @@ export default { ...@@ -68,7 +68,7 @@ export default {
data-placement="bottom" data-placement="bottom"
class="edit-group btn btn-xs no-expand" class="edit-group btn btn-xs no-expand"
> >
<icon name="settings" css-classes="position-top-0" /> <icon name="settings" class="position-top-0" />
</a> </a>
</div> </div>
</template> </template>
...@@ -86,7 +86,7 @@ export default { ...@@ -86,7 +86,7 @@ export default {
data-placement="left" data-placement="left"
class="append-bottom-10" class="append-bottom-10"
> >
<icon :name="additionIconName" :size="18" :css-classes="addedFilesIconClass" /> <icon :name="additionIconName" :size="18" :class="addedFilesIconClass" />
</div> </div>
{{ addedFilesLength }} {{ addedFilesLength }}
<div <div
...@@ -96,7 +96,7 @@ export default { ...@@ -96,7 +96,7 @@ export default {
data-placement="left" data-placement="left"
class="prepend-top-10 append-bottom-10" class="prepend-top-10 append-bottom-10"
> >
<icon :name="modifiedIconName" :size="18" :css-classes="modifiedFilesClass" /> <icon :name="modifiedIconName" :size="18" :class="modifiedFilesClass" />
</div> </div>
{{ modifiedFilesLength }} {{ modifiedFilesLength }}
</div> </div>
......
...@@ -114,7 +114,7 @@ export default { ...@@ -114,7 +114,7 @@ export default {
</span> </span>
<div class="ml-auto d-flex align-items-center"> <div class="ml-auto d-flex align-items-center">
<div class="d-flex align-items-center ide-commit-list-changed-icon"> <div class="d-flex align-items-center ide-commit-list-changed-icon">
<icon :name="iconName" :size="16" :css-classes="iconClass" /> <icon :name="iconName" :size="16" :class="iconClass" />
</div> </div>
</div> </div>
</div> </div>
......
...@@ -28,7 +28,7 @@ export default { ...@@ -28,7 +28,7 @@ export default {
rel="noopener noreferrer" rel="noopener noreferrer"
> >
<span class="vertical-align-middle">{{ __('Open in file view') }}</span> <span class="vertical-align-middle">{{ __('Open in file view') }}</span>
<icon :size="16" name="external-link" css-classes="vertical-align-middle space-right" /> <icon :size="16" name="external-link" class="vertical-align-middle space-right" />
</a> </a>
</div> </div>
</template> </template>
...@@ -79,7 +79,7 @@ export default { ...@@ -79,7 +79,7 @@ export default {
data-container="body" data-container="body"
data-placement="right" data-placement="right"
name="file-modified" name="file-modified"
css-classes="prepend-left-5 ide-file-modified" class="prepend-left-5 ide-file-modified"
/> />
</span> </span>
<changed-file-icon <changed-file-icon
......
...@@ -77,7 +77,7 @@ export default { ...@@ -77,7 +77,7 @@ export default {
<div v-if="!stage.isLoading || stage.jobs.length" class="append-right-8 prepend-left-4"> <div v-if="!stage.isLoading || stage.jobs.length" class="append-right-8 prepend-left-4">
<span class="badge badge-pill"> {{ jobsCount }} </span> <span class="badge badge-pill"> {{ jobsCount }} </span>
</div> </div>
<icon :name="collapseIcon" css-classes="ide-stage-collapse-icon" /> <icon :name="collapseIcon" class="ide-stage-collapse-icon" />
</div> </div>
<div v-show="!stage.isCollapsed" class="card-body"> <div v-show="!stage.isCollapsed" class="card-body">
<gl-loading-icon v-if="showLoadingIcon" /> <gl-loading-icon v-if="showLoadingIcon" />
......
...@@ -18,6 +18,6 @@ export default { ...@@ -18,6 +18,6 @@ export default {
:title="__('Part of merge request changes')" :title="__('Part of merge request changes')"
:size="12" :size="12"
name="git-merge" name="git-merge"
css-classes="append-right-8" class="append-right-8"
/> />
</template> </template>
...@@ -52,7 +52,7 @@ export default { ...@@ -52,7 +52,7 @@ export default {
class="btn-blank" class="btn-blank"
@click.stop.prevent="clicked" @click.stop.prevent="clicked"
> >
<icon :name="icon" :css-classes="iconClasses" /> <icon :name="icon" :class="iconClasses" />
<template v-if="showLabel"> <template v-if="showLabel">
{{ label }} {{ label }}
</template> </template>
......
...@@ -29,6 +29,6 @@ export default { ...@@ -29,6 +29,6 @@ export default {
<template> <template>
<span v-if="file.file_lock" v-tooltip :title="lockTooltip" data-container="body"> <span v-if="file.file_lock" v-tooltip :title="lockTooltip" data-container="body">
<icon name="lock" css-classes="file-status-icon" /> <icon name="lock" class="file-status-icon" />
</span> </span>
</template> </template>
...@@ -149,9 +149,9 @@ export default { ...@@ -149,9 +149,9 @@ export default {
title="Add reaction" title="Add reaction"
data-position="right" data-position="right"
> >
<icon css-classes="link-highlight award-control-icon-neutral" name="slight-smile" /> <icon class="link-highlight award-control-icon-neutral" name="slight-smile" />
<icon css-classes="link-highlight award-control-icon-positive" name="smiley" /> <icon class="link-highlight award-control-icon-positive" name="smiley" />
<icon css-classes="link-highlight award-control-icon-super-positive" name="smiley" /> <icon class="link-highlight award-control-icon-super-positive" name="smiley" />
</a> </a>
</div> </div>
<reply-button <reply-button
...@@ -168,7 +168,7 @@ export default { ...@@ -168,7 +168,7 @@ export default {
class="note-action-button js-note-edit btn btn-transparent qa-note-edit-button" class="note-action-button js-note-edit btn btn-transparent qa-note-edit-button"
@click="onEdit" @click="onEdit"
> >
<icon name="pencil" css-classes="link-highlight" /> <icon name="pencil" class="link-highlight" />
</button> </button>
</div> </div>
<div v-if="showDeleteAction" class="note-actions-item"> <div v-if="showDeleteAction" class="note-actions-item">
...@@ -191,7 +191,7 @@ export default { ...@@ -191,7 +191,7 @@ export default {
data-toggle="dropdown" data-toggle="dropdown"
@click="closeTooltip" @click="closeTooltip"
> >
<icon css-classes="icon" name="ellipsis_v" /> <icon class="icon" name="ellipsis_v" />
</button> </button>
<ul class="dropdown-menu more-actions-dropdown dropdown-open-left"> <ul class="dropdown-menu more-actions-dropdown dropdown-open-left">
<li v-if="canReportAsAbuse"> <li v-if="canReportAsAbuse">
......
...@@ -26,7 +26,7 @@ export default { ...@@ -26,7 +26,7 @@ export default {
:title="__('Reply to comment')" :title="__('Reply to comment')"
@click="$emit('startReplying')" @click="$emit('startReplying')"
> >
<icon name="comment" css-classes="link-highlight" /> <icon name="comment" class="link-highlight" />
</gl-button> </gl-button>
</div> </div>
</template> </template>
...@@ -194,9 +194,9 @@ export default { ...@@ -194,9 +194,9 @@ export default {
v-show="noEmoji" v-show="noEmoji"
class="js-no-emoji-placeholder no-emoji-placeholder position-relative" class="js-no-emoji-placeholder no-emoji-placeholder position-relative"
> >
<icon name="slight-smile" css-classes="award-control-icon-neutral" /> <icon name="slight-smile" class="award-control-icon-neutral" />
<icon name="smiley" css-classes="award-control-icon-positive" /> <icon name="smiley" class="award-control-icon-positive" />
<icon name="smile" css-classes="award-control-icon-super-positive" /> <icon name="smile" class="award-control-icon-super-positive" />
</span> </span>
</button> </button>
</span> </span>
......
...@@ -82,11 +82,7 @@ export default { ...@@ -82,11 +82,7 @@ export default {
data-boundary="viewport" data-boundary="viewport"
@click="handleButtonClick" @click="handleButtonClick"
> >
<icon <icon v-show="collapsed" :class="collapsedButtonIconClasses" :name="collapsedButtonIcon" />
v-show="collapsed"
:css-classes="collapsedButtonIconClasses"
:name="collapsedButtonIcon"
/>
<span v-show="!collapsed" class="issuable-todo-inner"> {{ buttonLabel }} </span> <span v-show="!collapsed" class="issuable-todo-inner"> {{ buttonLabel }} </span>
<gl-loading-icon v-show="isActionActive" :inline="true" /> <gl-loading-icon v-show="isActionActive" :inline="true" />
</button> </button>
......
...@@ -19,6 +19,6 @@ export default { ...@@ -19,6 +19,6 @@ export default {
</script> </script>
<template> <template>
<a :href="link" target="_blank" rel="noopener noreferrer nofollow" :class="cssClass"> <a :href="link" target="_blank" rel="noopener noreferrer nofollow" :class="cssClass">
{{ __('View app') }} <icon css-classes="fgray" name="external-link" /> {{ __('View app') }} <icon class="fgray" name="external-link" />
</a> </a>
</template> </template>
...@@ -83,7 +83,7 @@ export default { ...@@ -83,7 +83,7 @@ export default {
:class="{ 'ml-auto': isCentered }" :class="{ 'ml-auto': isCentered }"
class="file-changed-icon d-inline-block" class="file-changed-icon d-inline-block"
> >
<icon v-if="showIcon" :name="changedIcon" :size="size" :css-classes="changedIconClass" /> <icon v-if="showIcon" :name="changedIcon" :size="size" :class="changedIconClass" />
</span> </span>
</template> </template>
......
...@@ -66,5 +66,5 @@ export default { ...@@ -66,5 +66,5 @@ export default {
}; };
</script> </script>
<template> <template>
<span :class="cssClass"> <icon :name="icon" :size="size" :css-classes="cssClasses" /> </span> <span :class="cssClass"> <icon :name="icon" :size="size" :class="cssClasses" /> </span>
</template> </template>
...@@ -40,7 +40,7 @@ export default { ...@@ -40,7 +40,7 @@ export default {
</template> </template>
</p> </p>
<gl-link :href="path" class="btn btn-default" rel="nofollow" download target="_blank"> <gl-link :href="path" class="btn btn-default" rel="nofollow" download target="_blank">
<icon :size="16" name="download" css-classes="float-left append-right-8" /> <icon :size="16" name="download" class="float-left append-right-8" />
{{ __('Download') }} {{ __('Download') }}
</gl-link> </gl-link>
</div> </div>
......
...@@ -75,7 +75,7 @@ export default { ...@@ -75,7 +75,7 @@ export default {
<svg v-if="!loading && !folder" :class="[iconSizeClass, cssClasses]"> <svg v-if="!loading && !folder" :class="[iconSizeClass, cssClasses]">
<use v-bind="{ 'xlink:href': spriteHref }" /> <use v-bind="{ 'xlink:href': spriteHref }" />
</svg> </svg>
<icon v-if="!loading && folder" :name="folderIconName" :size="size" css-classes="folder-icon" /> <icon v-if="!loading && folder" :name="folderIconName" :size="size" class="folder-icon" />
<gl-loading-icon v-if="loading" :inline="true" /> <gl-loading-icon v-if="loading" :inline="true" />
</span> </span>
</template> </template>
...@@ -27,7 +27,7 @@ if (process.env.NODE_ENV !== 'production') { ...@@ -27,7 +27,7 @@ if (process.env.NODE_ENV !== 'production') {
* <icon * <icon
* name="retry" * name="retry"
* :size="32" * :size="32"
* css-classes="top" * class="top"
* /> * />
*/ */
export default { export default {
...@@ -42,45 +42,7 @@ export default { ...@@ -42,45 +42,7 @@ export default {
type: Number, type: Number,
required: false, required: false,
default: 16, default: 16,
validator(value) { validator: value => validSizes.includes(value),
return validSizes.includes(value);
},
},
cssClasses: {
type: String,
required: false,
default: '',
},
width: {
type: Number,
required: false,
default: null,
},
height: {
type: Number,
required: false,
default: null,
},
y: {
type: Number,
required: false,
default: null,
},
x: {
type: Number,
required: false,
default: null,
},
tabIndex: {
type: String,
required: false,
default: null,
}, },
}, },
...@@ -99,15 +61,7 @@ export default { ...@@ -99,15 +61,7 @@ export default {
</script> </script>
<template> <template>
<svg <svg :class="[iconSizeClass, iconTestClass]" aria-hidden="true">
:class="[iconSizeClass, iconTestClass, cssClasses]"
:width="width"
:height="height"
:x="x"
:y="y"
:tabindex="tabIndex"
aria-hidden="true"
>
<use v-bind="{ 'xlink:href': spriteHref }" /> <use v-bind="{ 'xlink:href': spriteHref }" />
</svg> </svg>
</template> </template>
...@@ -63,7 +63,7 @@ export default { ...@@ -63,7 +63,7 @@ export default {
<icon <icon
v-if="hasState" v-if="hasState"
ref="iconElementXL" ref="iconElementXL"
:css-classes="iconClass" :class="iconClass"
:name="iconName" :name="iconName"
:size="16" :size="16"
:title="stateTitle" :title="stateTitle"
...@@ -100,7 +100,7 @@ export default { ...@@ -100,7 +100,7 @@ export default {
<span ref="iconElement"> <span ref="iconElement">
<icon <icon
v-if="hasState" v-if="hasState"
:css-classes="iconClass" :class="iconClass"
:name="iconName" :name="iconName"
:title="stateTitle" :title="stateTitle"
:aria-label="state" :aria-label="state"
......
...@@ -74,7 +74,7 @@ export default { ...@@ -74,7 +74,7 @@ export default {
@click="toggleFeature" @click="toggleFeature"
> >
<gl-loading-icon class="loading-icon" /> <gl-loading-icon class="loading-icon" />
<span class="toggle-icon"> <icon :name="toggleIcon" css-classes="toggle-icon-svg" /> </span> <span class="toggle-icon"> <icon :name="toggleIcon" class="toggle-icon-svg" /> </span>
</button> </button>
</label> </label>
</template> </template>
...@@ -71,15 +71,11 @@ export default { ...@@ -71,15 +71,11 @@ export default {
</div> </div>
<div class="text-secondary"> <div class="text-secondary">
<div v-if="user.bio" class="js-bio d-flex mb-1"> <div v-if="user.bio" class="js-bio d-flex mb-1">
<icon name="profile" css-classes="category-icon flex-shrink-0" /> <icon name="profile" class="category-icon flex-shrink-0" />
<span class="ml-1">{{ user.bio }}</span> <span class="ml-1">{{ user.bio }}</span>
</div> </div>
<div v-if="user.organization" class="js-organization d-flex mb-1"> <div v-if="user.organization" class="js-organization d-flex mb-1">
<icon <icon v-show="!jobInfoIsLoading" name="work" class="category-icon flex-shrink-0" />
v-show="!jobInfoIsLoading"
name="work"
css-classes="category-icon flex-shrink-0"
/>
<span class="ml-1">{{ user.organization }}</span> <span class="ml-1">{{ user.organization }}</span>
</div> </div>
<gl-skeleton-loading <gl-skeleton-loading
...@@ -92,7 +88,7 @@ export default { ...@@ -92,7 +88,7 @@ export default {
<icon <icon
v-show="!locationIsLoading && user.location" v-show="!locationIsLoading && user.location"
name="location" name="location"
css-classes="category-icon flex-shrink-0" class="category-icon flex-shrink-0"
/> />
<span class="ml-1">{{ user.location }}</span> <span class="ml-1">{{ user.location }}</span>
<gl-skeleton-loading <gl-skeleton-loading
......
...@@ -59,8 +59,8 @@ export default { ...@@ -59,8 +59,8 @@ export default {
<template> <template>
<icon <icon
name="issues" name="issues"
:size="72" :size="24"
css-classes="icon-danger" class="icon-danger"
/> />
</template> </template>
``` ```
......
...@@ -40,7 +40,7 @@ export default { ...@@ -40,7 +40,7 @@ export default {
class="more-actions-toggle btn btn-transparent p-0" class="more-actions-toggle btn btn-transparent p-0"
data-toggle="dropdown" data-toggle="dropdown"
> >
<icon css-classes="icon" name="ellipsis_v" /> <icon class="icon" name="ellipsis_v" />
</gl-button> </gl-button>
<ul class="more-actions-dropdown dropdown-menu dropdown-open-left"> <ul class="more-actions-dropdown dropdown-menu dropdown-open-left">
<slot name="dropdown-options"></slot> <slot name="dropdown-options"></slot>
......
...@@ -30,7 +30,7 @@ export default { ...@@ -30,7 +30,7 @@ export default {
tabindex="1" tabindex="1"
v-on="$listeners" v-on="$listeners"
> >
<icon name="weight" css-classes="board-card-info-icon" /> <icon name="weight" class="board-card-info-icon" />
<span class="board-card-info-text"> {{ weight }} </span> <span class="board-card-info-text"> {{ weight }} </span>
<gl-tooltip <gl-tooltip
:target="() => $refs.itemWeight" :target="() => $refs.itemWeight"
......
...@@ -77,7 +77,7 @@ export default { ...@@ -77,7 +77,7 @@ export default {
<div class="card-body p-0 d-flex align-items-center overflow-hidden position-relative"> <div class="card-body p-0 d-flex align-items-center overflow-hidden position-relative">
<div v-if="icon.name" class="design-event position-absolute"> <div v-if="icon.name" class="design-event position-absolute">
<span :title="icon.tooltip" :aria-label="icon.tooltip"> <span :title="icon.tooltip" :aria-label="icon.tooltip">
<icon :name="icon.name" :size="18" :css-classes="icon.classes" /> <icon :name="icon.name" :size="18" :class="icon.classes" />
</span> </span>
</div> </div>
<img :src="image" :alt="name" class="block ml-auto mr-auto mw-100 mh-100 design-img" /> <img :src="image" :alt="name" class="block ml-auto mr-auto mw-100 mh-100 design-img" />
......
...@@ -68,7 +68,7 @@ export default { ...@@ -68,7 +68,7 @@ export default {
v-gl-tooltip v-gl-tooltip
:title="$options.tooltips.information" :title="$options.tooltips.information"
name="information" name="information"
css-classes="dashboard-card-icon" class="dashboard-card-icon"
/> />
<review-app-link <review-app-link
v-else-if="environment.external_url" v-else-if="environment.external_url"
......
...@@ -82,7 +82,7 @@ export default { ...@@ -82,7 +82,7 @@ export default {
:class="{ 'status-box-open': isEpicOpen, 'status-box-issue-closed': !isEpicOpen }" :class="{ 'status-box-open': isEpicOpen, 'status-box-issue-closed': !isEpicOpen }"
class="issuable-status-box status-box" class="issuable-status-box status-box"
> >
<icon :name="statusIcon" css-classes="d-block d-sm-none" /> <icon :name="statusIcon" class="d-block d-sm-none" />
<span class="d-none d-sm-block">{{ statusText }}</span> <span class="d-none d-sm-block">{{ statusText }}</span>
</div> </div>
<div class="issuable-meta"> <div class="issuable-meta">
......
...@@ -199,8 +199,8 @@ export default { ...@@ -199,8 +199,8 @@ export default {
<icon <icon
v-popover="popoverOptions" v-popover="popoverOptions"
name="question-o" name="question-o"
css-classes="help-icon append-right-5" class="help-icon append-right-5"
tab-index="0" tabindex="0"
/> />
<gl-button <gl-button
v-show="canUpdate && !editing" v-show="canUpdate && !editing"
...@@ -244,8 +244,8 @@ export default { ...@@ -244,8 +244,8 @@ export default {
v-if="isDateInvalid && selectedDateIsFixed" v-if="isDateInvalid && selectedDateIsFixed"
v-popover="dateInvalidPopoverOptions" v-popover="dateInvalidPopoverOptions"
name="warning" name="warning"
css-classes="date-warning-icon append-right-5 prepend-left-5" class="date-warning-icon append-right-5 prepend-left-5"
tab-index="0" tabindex="0"
/> />
<span v-if="selectedAndEditable" class="no-value d-flex"> <span v-if="selectedAndEditable" class="no-value d-flex">
&nbsp;&ndash;&nbsp; &nbsp;&ndash;&nbsp;
...@@ -282,8 +282,8 @@ export default { ...@@ -282,8 +282,8 @@ export default {
v-if="isDateInvalid && !selectedDateIsFixed" v-if="isDateInvalid && !selectedDateIsFixed"
v-popover="dateInvalidPopoverOptions" v-popover="dateInvalidPopoverOptions"
name="warning" name="warning"
css-classes="date-warning-icon prepend-left-5" class="date-warning-icon prepend-left-5"
tab-index="0" tabindex="0"
/> />
</abbr> </abbr>
</div> </div>
......
...@@ -128,7 +128,7 @@ export default { ...@@ -128,7 +128,7 @@ export default {
v-if="hasHelpInfo" v-if="hasHelpInfo"
v-popover="popoverConfig" v-popover="popoverConfig"
:size="12" :size="12"
css-classes="node-detail-help-text prepend-left-5" class="node-detail-help-text prepend-left-5"
name="question" name="question"
/> />
</div> </div>
...@@ -148,7 +148,7 @@ export default { ...@@ -148,7 +148,7 @@ export default {
v-tooltip v-tooltip
:title="itemValueStaleTooltip" :title="itemValueStaleTooltip"
name="time-out" name="time-out"
css-classes="prepend-left-10 detail-value-stale-icon" class="prepend-left-10 detail-value-stale-icon"
data-container="body" data-container="body"
/> />
</div> </div>
......
...@@ -81,7 +81,7 @@ export default { ...@@ -81,7 +81,7 @@ export default {
v-tooltip v-tooltip
:name="nodeStatusIconName" :name="nodeStatusIconName"
:size="18" :size="18"
:css-classes="nodeStatusIconClass" :class="nodeStatusIconClass"
:title="nodeStatusIconTooltip" :title="nodeStatusIconTooltip"
data-container="body" data-container="body"
data-placement="bottom" data-placement="bottom"
......
...@@ -118,7 +118,7 @@ export default { ...@@ -118,7 +118,7 @@ export default {
data-placement="bottom" data-placement="bottom"
> >
<strong>{{ syncType }}</strong> <strong>{{ syncType }}</strong>
<icon name="retry" css-classes="sync-status-icon prepend-left-5" /> <icon name="retry" class="sync-status-icon prepend-left-5" />
<span v-if="!eventTimestampEmpty" class="sync-status-event-info prepend-left-5"> <span v-if="!eventTimestampEmpty" class="sync-status-event-info prepend-left-5">
{{ syncStatusEventInfo }} {{ syncStatusEventInfo }}
</span> </span>
......
...@@ -44,7 +44,7 @@ export default { ...@@ -44,7 +44,7 @@ export default {
<span class="mr-2 text">{{ title }}</span> <span class="mr-2 text">{{ title }}</span>
<button ref="popoverTarget" type="button" class="btn-link information-target"> <button ref="popoverTarget" type="button" class="btn-link information-target">
<icon name="information" css-classes="icon d-block" /> <icon name="information" class="icon d-block" />
</button> </button>
<gl-popover <gl-popover
......
...@@ -75,7 +75,7 @@ export default { ...@@ -75,7 +75,7 @@ export default {
<icon <icon
v-if="hasState" v-if="hasState"
v-tooltip v-tooltip
:css-classes="iconClass" :class="iconClass"
:name="iconName" :name="iconName"
:size="12" :size="12"
:title="stateTitle" :title="stateTitle"
......
...@@ -61,7 +61,7 @@ export default { ...@@ -61,7 +61,7 @@ export default {
:class="{ 'ml-2': index }" :class="{ 'ml-2': index }"
class="d-inline-flex align-items-center" class="d-inline-flex align-items-center"
> >
<icon :size="16" :name="item.iconName" css-classes="text-secondary mr-1" /> <icon :size="16" :name="item.iconName" class="text-secondary mr-1" />
{{ item.count }} {{ item.count }}
</span> </span>
</div> </div>
......
...@@ -110,7 +110,7 @@ export default { ...@@ -110,7 +110,7 @@ export default {
<div class="item-title d-flex align-items-center mb-1 mb-xl-0"> <div class="item-title d-flex align-items-center mb-1 mb-xl-0">
<icon <icon
ref="stateIconLg" ref="stateIconLg"
:css-classes="stateIconClass" :class="stateIconClass"
:name="stateIconName" :name="stateIconName"
:size="16" :size="16"
:aria-label="stateText" :aria-label="stateText"
...@@ -129,7 +129,7 @@ export default { ...@@ -129,7 +129,7 @@ export default {
:title="__('Confidential')" :title="__('Confidential')"
:aria-label="__('Confidential')" :aria-label="__('Confidential')"
name="eye-slash" name="eye-slash"
css-classes="confidential-icon append-right-4 align-self-baseline align-self-md-auto mt-xl-0" class="confidential-icon append-right-4 align-self-baseline align-self-md-auto mt-xl-0"
/> />
<gl-link :href="computedPath" class="sortable-link">{{ item.title }}</gl-link> <gl-link :href="computedPath" class="sortable-link">{{ item.title }}</gl-link>
</div> </div>
...@@ -139,7 +139,7 @@ export default { ...@@ -139,7 +139,7 @@ export default {
> >
<icon <icon
ref="stateIconMd" ref="stateIconMd"
:css-classes="stateIconClass" :class="stateIconClass"
:name="stateIconName" :name="stateIconName"
:size="16" :size="16"
:aria-label="stateText" :aria-label="stateText"
...@@ -193,7 +193,7 @@ export default { ...@@ -193,7 +193,7 @@ export default {
class="btn-svg btn-item-remove js-issue-item-remove-button qa-remove-issue-button" class="btn-svg btn-item-remove js-issue-item-remove-button qa-remove-issue-button"
@click="handleRemoveClick" @click="handleRemoveClick"
> >
<icon :size="16" name="close" css-classes="btn-item-remove-icon" /> <icon :size="16" name="close" class="btn-item-remove-icon" />
</gl-button> </gl-button>
<span v-if="!parentItem.userPermissions.adminEpic" class="p-3"></span> <span v-if="!parentItem.userPermissions.adminEpic" class="p-3"></span>
</div> </div>
......
...@@ -84,7 +84,7 @@ export default { ...@@ -84,7 +84,7 @@ export default {
<icon <icon
v-show="vulnerability.dismissal_feedback.comment_details" v-show="vulnerability.dismissal_feedback.comment_details"
name="comment" name="comment"
css-classes="text-warning vertical-align-middle" class="text-warning vertical-align-middle"
/> />
<span class="vertical-align-middle text-uppercase">{{ <span class="vertical-align-middle text-uppercase">{{
s__('vulnerability|dismissed') s__('vulnerability|dismissed')
......
...@@ -33,7 +33,7 @@ export default { ...@@ -33,7 +33,7 @@ export default {
<icon <icon
v-gl-tooltip v-gl-tooltip
name="issue-created" name="issue-created"
css-classes="text-success vertical-align-middle" class="text-success vertical-align-middle"
:title="s__('Security Dashboard|Issue Created')" :title="s__('Security Dashboard|Issue Created')"
/> />
<a :href="issue.issue_url" class="vertical-align-middle">{{ linkText }}</a> <a :href="issue.issue_url" class="vertical-align-middle">{{ linkText }}</a>
......
...@@ -147,7 +147,7 @@ export default { ...@@ -147,7 +147,7 @@ export default {
<template slot="modal-ok"> <template slot="modal-ok">
<a :href="link" target="_blank" rel="noopener noreferrer nofollow" class="text-white"> <a :href="link" target="_blank" rel="noopener noreferrer nofollow" class="text-white">
{{ s__('VisualReviewApp|Open review app') }} {{ s__('VisualReviewApp|Open review app') }}
<icon css-classes="fwhite" name="external-link" /> <icon class="fwhite" name="external-link" />
</a> </a>
</template> </template>
<p v-html="instructionText.intro.p1"></p> <p v-html="instructionText.intro.p1"></p>
......
...@@ -93,7 +93,7 @@ export default { ...@@ -93,7 +93,7 @@ export default {
:title="button.title" :title="button.title"
@click="$emit(button.emit)" @click="$emit(button.emit)"
> >
<icon :name="button.iconName" css-classes="link-highlight" /> <icon :name="button.iconName" class="link-highlight" />
</gl-button> </gl-button>
</div> </div>
</div> </div>
......
...@@ -34,7 +34,6 @@ exports[`MetricChart component template when isLoading is false and chartData is ...@@ -34,7 +34,6 @@ exports[`MetricChart component template when isLoading is false and chartData is
<icon-stub <icon-stub
aria-label="Selected" aria-label="Selected"
class="flex-shrink-0 append-right-4 invisible" class="flex-shrink-0 append-right-4 invisible"
cssclasses=""
name="mobile-issue-close" name="mobile-issue-close"
size="16" size="16"
title="Selected" title="Selected"
...@@ -54,7 +53,6 @@ exports[`MetricChart component template when isLoading is false and chartData is ...@@ -54,7 +53,6 @@ exports[`MetricChart component template when isLoading is false and chartData is
<icon-stub <icon-stub
aria-label="Selected" aria-label="Selected"
class="flex-shrink-0 append-right-4 invisible" class="flex-shrink-0 append-right-4 invisible"
cssclasses=""
name="mobile-issue-close" name="mobile-issue-close"
size="16" size="16"
title="Selected" title="Selected"
......
...@@ -51,7 +51,6 @@ exports[`MergeRequestTable component matches the snapshot 1`] = ` ...@@ -51,7 +51,6 @@ exports[`MergeRequestTable component matches the snapshot 1`] = `
> >
<icon-stub <icon-stub
class="flex-shrink-0 append-right-4 invisible" class="flex-shrink-0 append-right-4 invisible"
cssclasses=""
name="mobile-issue-close" name="mobile-issue-close"
size="16" size="16"
/> />
...@@ -69,7 +68,6 @@ exports[`MergeRequestTable component matches the snapshot 1`] = ` ...@@ -69,7 +68,6 @@ exports[`MergeRequestTable component matches the snapshot 1`] = `
> >
<icon-stub <icon-stub
class="flex-shrink-0 append-right-4" class="flex-shrink-0 append-right-4"
cssclasses=""
name="mobile-issue-close" name="mobile-issue-close"
size="16" size="16"
/> />
...@@ -87,7 +85,6 @@ exports[`MergeRequestTable component matches the snapshot 1`] = ` ...@@ -87,7 +85,6 @@ exports[`MergeRequestTable component matches the snapshot 1`] = `
> >
<icon-stub <icon-stub
class="flex-shrink-0 append-right-4 invisible" class="flex-shrink-0 append-right-4 invisible"
cssclasses=""
name="mobile-issue-close" name="mobile-issue-close"
size="16" size="16"
/> />
......
...@@ -18,7 +18,6 @@ exports[`DependenciesActions component matches the snapshot 1`] = ` ...@@ -18,7 +18,6 @@ exports[`DependenciesActions component matches the snapshot 1`] = `
> >
<icon-stub <icon-stub
class="flex-shrink-0 append-right-4" class="flex-shrink-0 append-right-4"
cssclasses=""
name="mobile-issue-close" name="mobile-issue-close"
size="16" size="16"
/> />
...@@ -33,7 +32,6 @@ exports[`DependenciesActions component matches the snapshot 1`] = ` ...@@ -33,7 +32,6 @@ exports[`DependenciesActions component matches the snapshot 1`] = `
> >
<icon-stub <icon-stub
class="flex-shrink-0 append-right-4 invisible" class="flex-shrink-0 append-right-4 invisible"
cssclasses=""
name="mobile-issue-close" name="mobile-issue-close"
size="16" size="16"
/> />
...@@ -48,7 +46,6 @@ exports[`DependenciesActions component matches the snapshot 1`] = ` ...@@ -48,7 +46,6 @@ exports[`DependenciesActions component matches the snapshot 1`] = `
> >
<icon-stub <icon-stub
class="flex-shrink-0 append-right-4 invisible" class="flex-shrink-0 append-right-4 invisible"
cssclasses=""
name="mobile-issue-close" name="mobile-issue-close"
size="16" size="16"
/> />
...@@ -65,7 +62,6 @@ exports[`DependenciesActions component matches the snapshot 1`] = ` ...@@ -65,7 +62,6 @@ exports[`DependenciesActions component matches the snapshot 1`] = `
title="" title=""
> >
<icon-stub <icon-stub
cssclasses=""
name="sort-lowest" name="sort-lowest"
size="16" size="16"
/> />
...@@ -80,7 +76,6 @@ exports[`DependenciesActions component matches the snapshot 1`] = ` ...@@ -80,7 +76,6 @@ exports[`DependenciesActions component matches the snapshot 1`] = `
title="" title=""
> >
<icon-stub <icon-stub
cssclasses=""
name="download" name="download"
size="16" size="16"
/> />
......
...@@ -25,7 +25,6 @@ exports[`DependenciesTableRow component when a dependency with no vulnerabilitie ...@@ -25,7 +25,6 @@ exports[`DependenciesTableRow component when a dependency with no vulnerabilitie
> >
<icon-stub <icon-stub
class="align-middle mr-1" class="align-middle mr-1"
cssclasses=""
name="check-circle" name="check-circle"
size="16" size="16"
/> />
...@@ -160,7 +159,6 @@ exports[`DependenciesTableRow component when a dependency with vulnerabilities i ...@@ -160,7 +159,6 @@ exports[`DependenciesTableRow component when a dependency with vulnerabilities i
> >
<icon-stub <icon-stub
class="align-top text-secondary-700 d-none d-md-inline" class="align-top text-secondary-700 d-none d-md-inline"
cssclasses=""
name="arrow-down" name="arrow-down"
size="16" size="16"
/> />
......
...@@ -10,7 +10,6 @@ exports[`DependencyListAlert component given no props matches the snapshot 1`] = ...@@ -10,7 +10,6 @@ exports[`DependencyListAlert component given no props matches the snapshot 1`] =
> >
<icon-stub <icon-stub
aria-hidden="true" aria-hidden="true"
cssclasses=""
name="close" name="close"
size="16" size="16"
/> />
...@@ -37,7 +36,6 @@ exports[`DependencyListAlert component given the headerText prop matches the sna ...@@ -37,7 +36,6 @@ exports[`DependencyListAlert component given the headerText prop matches the sna
> >
<icon-stub <icon-stub
aria-hidden="true" aria-hidden="true"
cssclasses=""
name="close" name="close"
size="16" size="16"
/> />
...@@ -68,7 +66,6 @@ exports[`DependencyListAlert component given the warning type and headerText pro ...@@ -68,7 +66,6 @@ exports[`DependencyListAlert component given the warning type and headerText pro
> >
<icon-stub <icon-stub
aria-hidden="true" aria-hidden="true"
cssclasses=""
name="close" name="close"
size="16" size="16"
/> />
......
...@@ -64,7 +64,7 @@ exports[`Design management list item component renders item with correct status ...@@ -64,7 +64,7 @@ exports[`Design management list item component renders item with correct status
title="Added in this version" title="Added in this version"
> >
<icon-stub <icon-stub
cssclasses="text-success-500" class="text-success-500"
name="file-addition-solid" name="file-addition-solid"
size="18" size="18"
/> />
...@@ -125,7 +125,7 @@ exports[`Design management list item component renders item with correct status ...@@ -125,7 +125,7 @@ exports[`Design management list item component renders item with correct status
title="Deleted in this version" title="Deleted in this version"
> >
<icon-stub <icon-stub
cssclasses="text-danger-500" class="text-danger-500"
name="file-deletion-solid" name="file-deletion-solid"
size="18" size="18"
/> />
...@@ -186,7 +186,7 @@ exports[`Design management list item component renders item with correct status ...@@ -186,7 +186,7 @@ exports[`Design management list item component renders item with correct status
title="Modified in this version" title="Modified in this version"
> >
<icon-stub <icon-stub
cssclasses="text-primary-500" class="text-primary-500"
name="file-modified-solid" name="file-modified-solid"
size="18" size="18"
/> />
...@@ -279,7 +279,6 @@ exports[`Design management list item component renders item with multiple commen ...@@ -279,7 +279,6 @@ exports[`Design management list item component renders item with multiple commen
> >
<icon-stub <icon-stub
class="ml-1" class="ml-1"
cssclasses=""
name="comments" name="comments"
size="16" size="16"
/> />
...@@ -393,7 +392,6 @@ exports[`Design management list item component renders item with single comment ...@@ -393,7 +392,6 @@ exports[`Design management list item component renders item with single comment
> >
<icon-stub <icon-stub
class="ml-1" class="ml-1"
cssclasses=""
name="comments" name="comments"
size="16" size="16"
/> />
......
...@@ -9,7 +9,6 @@ exports[`Design management toolbar component renders design and updated data 1`] ...@@ -9,7 +9,6 @@ exports[`Design management toolbar component renders design and updated data 1`]
class="mr-3 text-plain" class="mr-3 text-plain"
> >
<icon-stub <icon-stub
cssclasses=""
name="close" name="close"
size="18" size="18"
/> />
......
...@@ -8,7 +8,6 @@ exports[`Design management pagination button component disables button when no d ...@@ -8,7 +8,6 @@ exports[`Design management pagination button component disables button when no d
to="[object Object]" to="[object Object]"
> >
<icon-stub <icon-stub
cssclasses=""
name="angle-right" name="angle-right"
size="16" size="16"
/> />
...@@ -22,7 +21,6 @@ exports[`Design management pagination button component renders router-link 1`] = ...@@ -22,7 +21,6 @@ exports[`Design management pagination button component renders router-link 1`] =
to="[object Object]" to="[object Object]"
> >
<icon-stub <icon-stub
cssclasses=""
name="angle-right" name="angle-right"
size="16" size="16"
/> />
......
...@@ -119,7 +119,7 @@ exports[`Environment Header with environments grouped into a folder matches the ...@@ -119,7 +119,7 @@ exports[`Environment Header with environments grouped into a folder matches the
</div> </div>
<icon-stub <icon-stub
cssclasses="dashboard-card-icon" class="dashboard-card-icon"
data-original-title="You are looking at the last updated environment" data-original-title="You are looking at the last updated environment"
name="information" name="information"
size="16" size="16"
......
...@@ -37,7 +37,6 @@ exports[`Environment matchs the snapshot 1`] = ` ...@@ -37,7 +37,6 @@ exports[`Environment matchs the snapshot 1`] = `
class="branch-commit" class="branch-commit"
> >
<icon-stub <icon-stub
cssclasses=""
name="work" name="work"
size="16" size="16"
/> />
......
...@@ -59,7 +59,6 @@ exports[`Project Header matches the snapshot 1`] = ` ...@@ -59,7 +59,6 @@ exports[`Project Header matches the snapshot 1`] = `
> >
<icon-stub <icon-stub
class="text-secondary" class="text-secondary"
cssclasses=""
name="ellipsis_v" name="ellipsis_v"
size="16" size="16"
/> />
......
...@@ -203,7 +203,6 @@ exports[`LicenseCardBody renders a loading state if isRemoving 1`] = ` ...@@ -203,7 +203,6 @@ exports[`LicenseCardBody renders a loading state if isRemoving 1`] = `
class="p-5 d-flex justify-content-center align-items-center license-card-loading" class="p-5 d-flex justify-content-center align-items-center license-card-loading"
> >
<icon-stub <icon-stub
cssclasses=""
name="spinner" name="spinner"
size="16" size="16"
/> />
......
...@@ -7,7 +7,6 @@ exports[`HeaderCell renders an inflexible cell with a title with an icon through ...@@ -7,7 +7,6 @@ exports[`HeaderCell renders an inflexible cell with a title with an icon through
<template> <template>
<icon-stub <icon-stub
class="icon" class="icon"
cssclasses=""
name="retry" name="retry"
size="16" size="16"
/> />
......
...@@ -18,7 +18,7 @@ exports[`InfoCell renders a number value 1`] = ` ...@@ -18,7 +18,7 @@ exports[`InfoCell renders a number value 1`] = `
type="button" type="button"
> >
<icon-stub <icon-stub
cssclasses="icon d-block" class="icon d-block"
name="information" name="information"
size="16" size="16"
/> />
...@@ -52,7 +52,7 @@ exports[`InfoCell renders a title and string value with an info popover through ...@@ -52,7 +52,7 @@ exports[`InfoCell renders a title and string value with an info popover through
type="button" type="button"
> >
<icon-stub <icon-stub
cssclasses="icon d-block" class="icon d-block"
name="information" name="information"
size="16" size="16"
/> />
......
...@@ -11,7 +11,6 @@ exports[`JumpToNextDiscussionButton matches the snapshot 1`] = ` ...@@ -11,7 +11,6 @@ exports[`JumpToNextDiscussionButton matches the snapshot 1`] = `
title="" title=""
> >
<icon-stub <icon-stub
cssclasses=""
name="comment-next" name="comment-next"
size="16" size="16"
/> />
......
...@@ -14,7 +14,6 @@ exports[`Confidential Issue Sidebar Block renders for isConfidential = false and ...@@ -14,7 +14,6 @@ exports[`Confidential Issue Sidebar Block renders for isConfidential = false and
> >
<icon-stub <icon-stub
aria-hidden="true" aria-hidden="true"
cssclasses=""
name="eye" name="eye"
size="16" size="16"
/> />
...@@ -40,7 +39,6 @@ exports[`Confidential Issue Sidebar Block renders for isConfidential = false and ...@@ -40,7 +39,6 @@ exports[`Confidential Issue Sidebar Block renders for isConfidential = false and
<icon-stub <icon-stub
aria-hidden="true" aria-hidden="true"
class="sidebar-item-icon inline" class="sidebar-item-icon inline"
cssclasses=""
name="eye" name="eye"
size="16" size="16"
/> />
...@@ -68,7 +66,6 @@ exports[`Confidential Issue Sidebar Block renders for isConfidential = false and ...@@ -68,7 +66,6 @@ exports[`Confidential Issue Sidebar Block renders for isConfidential = false and
> >
<icon-stub <icon-stub
aria-hidden="true" aria-hidden="true"
cssclasses=""
name="eye" name="eye"
size="16" size="16"
/> />
...@@ -104,7 +101,6 @@ exports[`Confidential Issue Sidebar Block renders for isConfidential = false and ...@@ -104,7 +101,6 @@ exports[`Confidential Issue Sidebar Block renders for isConfidential = false and
<icon-stub <icon-stub
aria-hidden="true" aria-hidden="true"
class="sidebar-item-icon inline" class="sidebar-item-icon inline"
cssclasses=""
name="eye" name="eye"
size="16" size="16"
/> />
...@@ -132,7 +128,6 @@ exports[`Confidential Issue Sidebar Block renders for isConfidential = true and ...@@ -132,7 +128,6 @@ exports[`Confidential Issue Sidebar Block renders for isConfidential = true and
> >
<icon-stub <icon-stub
aria-hidden="true" aria-hidden="true"
cssclasses=""
name="eye-slash" name="eye-slash"
size="16" size="16"
/> />
...@@ -158,7 +153,6 @@ exports[`Confidential Issue Sidebar Block renders for isConfidential = true and ...@@ -158,7 +153,6 @@ exports[`Confidential Issue Sidebar Block renders for isConfidential = true and
<icon-stub <icon-stub
aria-hidden="true" aria-hidden="true"
class="sidebar-item-icon inline is-active" class="sidebar-item-icon inline is-active"
cssclasses=""
name="eye-slash" name="eye-slash"
size="16" size="16"
/> />
...@@ -186,7 +180,6 @@ exports[`Confidential Issue Sidebar Block renders for isConfidential = true and ...@@ -186,7 +180,6 @@ exports[`Confidential Issue Sidebar Block renders for isConfidential = true and
> >
<icon-stub <icon-stub
aria-hidden="true" aria-hidden="true"
cssclasses=""
name="eye-slash" name="eye-slash"
size="16" size="16"
/> />
...@@ -222,7 +215,6 @@ exports[`Confidential Issue Sidebar Block renders for isConfidential = true and ...@@ -222,7 +215,6 @@ exports[`Confidential Issue Sidebar Block renders for isConfidential = true and
<icon-stub <icon-stub
aria-hidden="true" aria-hidden="true"
class="sidebar-item-icon inline is-active" class="sidebar-item-icon inline is-active"
cssclasses=""
name="eye-slash" name="eye-slash"
size="16" size="16"
/> />
......
...@@ -14,7 +14,7 @@ exports[`SidebarTodo template renders component container element with proper da ...@@ -14,7 +14,7 @@ exports[`SidebarTodo template renders component container element with proper da
type="button" type="button"
> >
<icon-stub <icon-stub
cssclasses="todo-undone" class="todo-undone"
name="todo-done" name="todo-done"
size="16" size="16"
style="display: none;" style="display: none;"
......
...@@ -44,7 +44,12 @@ describe('SidebarTodo', () => { ...@@ -44,7 +44,12 @@ describe('SidebarTodo', () => {
({ isTodo, iconClass, label, icon }) => { ({ isTodo, iconClass, label, icon }) => {
createComponent({ isTodo }); createComponent({ isTodo });
expect(wrapper.find(Icon).props('cssClasses')).toStrictEqual(iconClass); expect(
wrapper
.find(Icon)
.classes()
.join(' '),
).toStrictEqual(iconClass);
expect(wrapper.find(Icon).props('name')).toStrictEqual(icon); expect(wrapper.find(Icon).props('name')).toStrictEqual(icon);
expect(wrapper.find('button').text()).toBe(label); expect(wrapper.find('button').text()).toBe(label);
}, },
......
...@@ -28,10 +28,7 @@ describe('Changed file icon', () => { ...@@ -28,10 +28,7 @@ describe('Changed file icon', () => {
const findIcon = () => wrapper.find(Icon); const findIcon = () => wrapper.find(Icon);
const findIconName = () => findIcon().props('name'); const findIconName = () => findIcon().props('name');
const findIconClasses = () => const findIconClasses = () => findIcon().classes();
findIcon()
.props('cssClasses')
.split(' ');
const findTooltipText = () => wrapper.attributes('data-original-title'); const findTooltipText = () => wrapper.attributes('data-original-title');
it('with isCentered true, adds center class', () => { it('with isCentered true, adds center class', () => {
......
...@@ -49,7 +49,7 @@ describe('File Icon component', () => { ...@@ -49,7 +49,7 @@ describe('File Icon component', () => {
}); });
expect(findIcon().exists()).toBe(false); expect(findIcon().exists()).toBe(false);
expect(wrapper.find(Icon).props('cssClasses')).toContain('folder-icon'); expect(wrapper.find(Icon).classes()).toContain('folder-icon');
}); });
it('should render a loading icon', () => { it('should render a loading icon', () => {
......
...@@ -12,8 +12,6 @@ describe('Sprite Icon Component', function() { ...@@ -12,8 +12,6 @@ describe('Sprite Icon Component', function() {
icon = mountComponent(IconComponent, { icon = mountComponent(IconComponent, {
name: 'commit', name: 'commit',
size: 32, size: 32,
cssClasses: 'extraclasses',
tabIndex: '0',
}); });
}); });
...@@ -47,10 +45,8 @@ describe('Sprite Icon Component', function() { ...@@ -47,10 +45,8 @@ describe('Sprite Icon Component', function() {
it('should properly render img css', function() { it('should properly render img css', function() {
const { classList } = icon.$el; const { classList } = icon.$el;
const containsSizeClass = classList.contains('s32'); const containsSizeClass = classList.contains('s32');
const containsCustomClass = classList.contains('extraclasses');
expect(containsSizeClass).toBe(true); expect(containsSizeClass).toBe(true);
expect(containsCustomClass).toBe(true);
}); });
it('`name` validator should return false for non existing icons', () => { it('`name` validator should return false for non existing icons', () => {
...@@ -60,9 +56,5 @@ describe('Sprite Icon Component', function() { ...@@ -60,9 +56,5 @@ describe('Sprite Icon Component', function() {
it('`name` validator should return false for existing icons', () => { it('`name` validator should return false for existing icons', () => {
expect(Icon.props.name.validator('commit')).toBe(true); expect(Icon.props.name.validator('commit')).toBe(true);
}); });
it('should contain `tabindex` attribute on svg element when `tabIndex` prop is defined', () => {
expect(icon.$el.getAttribute('tabindex')).toBe('0');
});
}); });
}); });
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment