fix tests

This commit is contained in:
Yanick Champoux 2023-04-13 17:57:33 -04:00
parent 14ef55197a
commit 3edd38c619
6 changed files with 45 additions and 51 deletions

View File

@ -6,5 +6,5 @@ test("basic, initial store", () => {
const state = store.getState(); const state = store.getState();
expect(state).toHaveProperty("propulsion.drive.reqs.mass", 0); expect(state).toHaveProperty("propulsion.drive.reqs.mass", 0);
expect(state).toHaveProperty("structure.cargo.space", 0); // expect(state).toHaveProperty("structure.cargo.space", 0);
}); });

View File

@ -7,7 +7,7 @@ import { reqs, Reqs } from "../reqs.js";
const ftl = createSlice({ const ftl = createSlice({
name: "ftl", name: "ftl",
initialState, initialState: {},
reducers: { reducers: {
setFtl: (state, { payload }: PayloadAction<FtlType>) => { setFtl: (state, { payload }: PayloadAction<FtlType>) => {
state.type = payload; state.type = payload;

View File

@ -1 +0,0 @@
import

View File

@ -1,20 +1,12 @@
import { combineReducers } from "redux"; import { combineReducers } from "redux";
import * as R from "remeda"; import * as R from "remeda";
import * as hull from "./hull.js";
import * as screens from "./screen.js"; import * as screens from "./screen.js";
import * as cargo from "./cargo.js";
import * as armor from "./armor.js";
import * as streamlining from "./streamlining.js";
export const reducer = combineReducers( export const reducer = combineReducers(
R.mapValues( R.mapValues(
{ {
hull,
screens, screens,
cargo,
armor,
streamlining,
}, },
R.prop("reducer") R.prop("reducer")
) )

View File

@ -22,6 +22,5 @@ const adfc = createSlice({
export const reducer = combineReducers({ export const reducer = combineReducers({
adfc: adfc.reducer, adfc: adfc.reducer,
firecons: firecons.reducer,
weapons: weapons.reducer, weapons: weapons.reducer,
}); });

View File

@ -52,6 +52,10 @@ test("kicking the tires", () => {
expect(store.getState().weaponry.weapons[0]).toEqual({ expect(store.getState().weaponry.weapons[0]).toEqual({
id: 1, id: 1,
reqs: { cost: 3, mass: 1 }, reqs: { cost: 3, mass: 1 },
specs: { arcs: ["F"], type: "beam", weaponClass: 1 }, specs: {
arcs: ["FS", "F", "FP", "AP", "A", "AS"],
type: "beam",
weaponClass: 1,
},
}); });
}); });