-
Notifications
You must be signed in to change notification settings - Fork 0
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
822cfae
commit 127963b
Showing
58 changed files
with
1,077 additions
and
1,383 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
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
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,25 +1,25 @@ | ||
import { | ||
CARD_INDICES, | ||
CARD_LABELS, | ||
CARD_RANKS, | ||
MAXIMUM_CARD_COUNTING_VALUE, | ||
createCard, | ||
} from "./Card"; | ||
import { describe, expect, it } from "@jest/globals"; | ||
|
||
describe.each(CARD_INDICES)("createCard %p", (rankValue) => { | ||
it(`rankValue is ${rankValue}`, () => { | ||
expect(createCard(rankValue).rankValue).toBe(rankValue); | ||
describe.each(CARD_RANKS)("createCard %p", (rank) => { | ||
it(`rank is ${rank}`, () => { | ||
expect(createCard(rank).rank).toBe(rank); | ||
}); | ||
|
||
const expectedRankLabel = CARD_LABELS[rankValue]!; | ||
const expectedRankLabel = CARD_LABELS[rank]!; | ||
|
||
it(`rankLabel is ${expectedRankLabel}`, () => { | ||
expect(createCard(rankValue).rankLabel).toBe(expectedRankLabel); | ||
expect(createCard(rank).rankLabel).toBe(expectedRankLabel); | ||
}); | ||
|
||
const expectedCount = Math.min(rankValue + 1, MAXIMUM_CARD_COUNTING_VALUE); | ||
const expectedCount = Math.min(rank + 1, MAXIMUM_CARD_COUNTING_VALUE); | ||
|
||
it(`count is ${expectedCount}`, () => { | ||
expect(createCard(rankValue).count).toBe(expectedCount); | ||
expect(createCard(rank).count).toBe(expectedCount); | ||
}); | ||
}); |
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
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
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
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
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
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
@import url("./vars.css"); | ||
|
||
.card-label { | ||
font-family: var(--card-font-family); | ||
} | ||
|
||
.ten { | ||
transform: scaleX(0.5) translateX(-0.3em); | ||
} |
2 changes: 1 addition & 1 deletion
2
...ui-react/PossibleHandCard.module.css.d.ts → src/ui-react/CardLabel.module.css.d.ts
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,5 +1,5 @@ | ||
declare const classes: { | ||
readonly card: string; | ||
readonly cardLabel: string; | ||
readonly ten: string; | ||
}; | ||
export = classes; |
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 |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import type { Meta, StoryObj } from "@storybook/react"; | ||
import { CARDS } from "../game/Card"; | ||
import { CardLabel } from "./CardLabel"; | ||
|
||
const meta = { | ||
component: CardLabel, | ||
parameters: { | ||
layout: "centered", | ||
}, | ||
tags: ["autodocs"], | ||
title: "CardLabel", | ||
} satisfies Meta<typeof CardLabel>; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof meta>; | ||
|
||
export const Ace: Story = { | ||
args: { | ||
rank: CARDS.ACE.rank, | ||
}, | ||
}; | ||
|
||
export const Five: Story = { | ||
args: { | ||
rank: CARDS.FIVE.rank, | ||
}, | ||
}; | ||
|
||
export const Nine: Story = { | ||
args: { | ||
rank: CARDS.NINE.rank, | ||
}, | ||
}; | ||
|
||
export const Ten: Story = { | ||
args: { | ||
rank: CARDS.TEN.rank, | ||
}, | ||
}; | ||
|
||
export const Jack: Story = { | ||
args: { | ||
rank: CARDS.JACK.rank, | ||
}, | ||
}; | ||
|
||
export const King: Story = { | ||
args: { | ||
rank: CARDS.KING.rank, | ||
}, | ||
}; |
Oops, something went wrong.