Compare commits
No commits in common. "1751df6a91517d8da4cfbd5f9dc876f8dde96c1d" and "b8c51953474815d0e01ea65090bb22cb360f8f07" have entirely different histories.
1751df6a91
...
b8c5195347
3 changed files with 2 additions and 40 deletions
|
@ -1,4 +1,3 @@
|
|||
export * from "./MockDataConnection";
|
||||
export * from "./MockPeer";
|
||||
export * from "./MockHelper";
|
||||
export * from "./EventHook";
|
||||
|
|
|
@ -1,38 +0,0 @@
|
|||
import CardPicker from "@/components/DeckBuilder/CardPicker.vue";
|
||||
import { shallowMount } from "@vue/test-utils";
|
||||
import { CardSlot } from "@/mlpccg";
|
||||
|
||||
// Generate 10 test cards
|
||||
const testCards = new Array(10)
|
||||
.fill("test")
|
||||
.map((t, i) => ({ ID: `${t}${i}` }));
|
||||
const testSlots = testCards.map(c => ({ data: c, limit: 3, howmany: 1 }));
|
||||
|
||||
describe("components/DeckBuilder/CardPicker", () => {
|
||||
test("CardPicker correctly creates images for each card", () => {
|
||||
const wrapper = shallowMount(CardPicker, {
|
||||
propsData: {
|
||||
rows: 2,
|
||||
columns: 5,
|
||||
cards: testSlots
|
||||
}
|
||||
});
|
||||
const cards = wrapper.findAll(".ccgcard");
|
||||
expect(cards.contains("img")).toBe(true);
|
||||
});
|
||||
|
||||
test("CardPicker correctly aligns items in a grid", () => {
|
||||
const wrapper = shallowMount(CardPicker, {
|
||||
propsData: {
|
||||
rows: 3,
|
||||
columns: 5,
|
||||
cards: testSlots
|
||||
}
|
||||
});
|
||||
const section = wrapper.find(".cardpicker");
|
||||
const style = section.attributes("style");
|
||||
expect(style).toMatch(
|
||||
/grid-template-rows: \S+ \S+ \S+; grid-template-columns: \S+ \S+ \S+ \S+ \S+;/i
|
||||
);
|
||||
});
|
||||
});
|
|
@ -1,5 +1,6 @@
|
|||
import { MockHelper, EventHook } from "@/testing";
|
||||
import { MockHelper } from "@/testing";
|
||||
import { NetworkMessage, LocalClient, ChatMessage } from "@/network";
|
||||
import { EventHook } from "@/testing/EventHook";
|
||||
|
||||
const sampleRoom = () => ({
|
||||
max_players: 3,
|
||||
|
|
Loading…
Reference in a new issue