accounts for permanent resources

This commit is contained in:
2022-08-05 20:28:07 -05:00
parent e0ad965ac2
commit 9c067172bf
4 changed files with 19 additions and 28 deletions

View File

@@ -2,10 +2,11 @@ import { expensiveCard, midGameCardOne, midGameCardTwo, midGameState, mockPlayer
import { buyCard, tooExpensive } from './buyCardActions';
import getTotalBuyingPower from '../../../util/getTotalBuyingPower';
import { useCurrentPlayer } from '../../../util/useCurrentPlayer';
import { AppState, PlayerData } from '../../../util/types';
import { AppState, CardData, PlayerData, ResourceCost } from '../../../util/types';
import { test, expect, describe, vi, afterEach } from 'vitest';
import { renderHook } from "@testing-library/react";
import React, { useState } from 'react';
import { turnOrderUtil } from '../../../util/turnOrderUtil';
afterEach(() => {
vi.restoreAllMocks();
@@ -37,7 +38,7 @@ describe('buy cards', () => {
]
}
const totalBuyingPower = getTotalBuyingPower(modifiedState);
const totalBuyingPower = getTotalBuyingPower(mockPlayerOne);
const expectedValue = {
ruby: 3,
@@ -50,25 +51,6 @@ describe('buy cards', () => {
expect(totalBuyingPower).toStrictEqual(expectedValue);
})
test('use state', () => {
const { result } = renderHook(() => {
const [state, setState] = useState('me');
setState('you');
return state;
})
expect(result.current).toBe('you');
})
test('buyCard and updateResources', () => {
/**
* actions in test:
* player triggers "buy card" action
* corresponding chips come out of player's hand
*
*/
})
})
// describe('get chips', () => {})