Skip to content

Commit

Permalink
add tests for family (#458)
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonlundien committed May 1, 2023
1 parent e047815 commit 444dbfa
Show file tree
Hide file tree
Showing 3 changed files with 463 additions and 384 deletions.
32 changes: 19 additions & 13 deletions src/components/__fixtures__/helpers.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
import { mount } from '@vue/test-utils'
import FontAwesomeIcon from '../FontAwesomeIcon'
import { parse } from '@fortawesome/fontawesome-svg-core'
import { mount } from "@vue/test-utils";
import FontAwesomeIcon from "../FontAwesomeIcon";
import { parse } from "@fortawesome/fontawesome-svg-core";

export function compileAndMount (definition, props = {}) {
return mount(definition, { props })
export function compileAndMount(definition, props = {}) {
return mount(definition, { props });
}

export function mountFromProps (props = {}) {
return mount(FontAwesomeIcon, { props })
export function mountFromProps(props = {}) {
return mount(FontAwesomeIcon, { props });
}

export function coreHasFeature (feature) {
if (feature === REFERENCE_ICON_BY_STYLE || feature === ICON_ALIASES || feature === REFERENCE_ICON_USING_STRING) {
return parse.icon
export function coreHasFeature(feature) {
if (
feature === REFERENCE_ICON_BY_STYLE ||
feature === ICON_ALIASES ||
feature === REFERENCE_ICON_USING_STRING ||
feature === REFERENCE_ICON_USING_FAMILY
) {
return parse.icon;
}
}

export const REFERENCE_ICON_BY_STYLE = 0x00
export const ICON_ALIASES = 0x01
export const REFERENCE_ICON_USING_STRING = 0x02
export const REFERENCE_ICON_BY_STYLE = 0x00;
export const ICON_ALIASES = 0x01;
export const REFERENCE_ICON_USING_STRING = 0x02;
export const REFERENCE_ICON_USING_FAMILY = 0x03;
48 changes: 18 additions & 30 deletions src/components/__fixtures__/icons.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,23 @@
export const faCoffee = {
prefix: 'fas',
iconName: 'coffee',
icon: [
640,
512,
[],
"f001",
"..."
]
}
prefix: "fas",
iconName: "coffee",
icon: [640, 512, [], "f001", "..."],
};

export const faCircle = {
prefix: 'fas',
iconName: 'circle',
icon: [
640,
512,
[],
"f002",
"..."
]
}
prefix: "fas",
iconName: "circle",
icon: [640, 512, [], "f002", "..."],
};

export const faAlien = {
prefix: 'fad',
iconName: 'alien',
icon: [
640,
512,
[],
"f003",
"..."
]
}
prefix: "fad",
iconName: "alien",
icon: [640, 512, [], "f003", "..."],
};

export const faDog = {
prefix: "fass",
iconName: "dog",
icon: [640, 512, [], "f200", "..."],
};

0 comments on commit 444dbfa

Please sign in to comment.