Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
41e73a1
commit a40e746
Showing
1 changed file
with
36 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,47 @@ | ||
import { shallowMount } from "@vue/test-utils"; | ||
import Status from '../Status.vue'; | ||
import Status from "../Status.vue"; | ||
import { assert } from "chai"; | ||
|
||
describe("Status test scripts", () => { | ||
test("Renders correctly", () => { | ||
const statusIcon = "available"; | ||
const type = "success"; | ||
const status = shallowMount(Status,{ | ||
propsData : { | ||
statusIcon, type | ||
} | ||
}); | ||
expect(status.element).toMatchSnapshot(); | ||
test("Renders correctly", () => { | ||
const statusIcon = "available"; | ||
const type = "success"; | ||
const status = shallowMount(Status, { | ||
propsData: { | ||
statusIcon, | ||
type | ||
} | ||
}); | ||
expect(status.element).toMatchSnapshot(); | ||
}); | ||
|
||
test("Default slot rendering test", () => { | ||
const slotText = "Status Slot Text"; | ||
const status = shallowMount(Status, { | ||
slots: { | ||
default : slotText | ||
} | ||
}); | ||
expect(status.text()).toBe(slotText); | ||
test("Default slot rendering test", () => { | ||
const slotText = "Status Slot Text"; | ||
const status = shallowMount(Status, { | ||
slots: { | ||
default: slotText | ||
} | ||
}); | ||
expect(status.text()).toBe(slotText); | ||
}); | ||
|
||
test("Status indicator with built in status icon test", () => { | ||
const statusIcon = "offline"; | ||
const status = shallowMount(Status, { | ||
propsData : { | ||
statusIcon | ||
} | ||
}); | ||
assert(status.classes(`fd-status-label--${statusIcon}`)); | ||
test("Status indicator with built in status icon test", () => { | ||
const statusIcon = "offline"; | ||
const status = shallowMount(Status, { | ||
propsData: { | ||
statusIcon | ||
} | ||
}); | ||
assert(status.classes(`fd-status-label--${statusIcon}`)); | ||
}); | ||
|
||
test("Status indicator with semantic colors", () => { | ||
const type = "warning"; | ||
const status = shallowMount(Status, { | ||
propsData : { | ||
type | ||
} | ||
}); | ||
assert(status.classes(`fd-status-label--${type}`)); | ||
|
||
test("Status indicator with semantic colors", () => { | ||
const type = "warning"; | ||
const status = shallowMount(Status, { | ||
propsData: { | ||
type | ||
} | ||
}); | ||
}); | ||
assert(status.classes(`fd-status-label--${type}`)); | ||
}); | ||
}); |