|
@@ -53,13 +53,32 @@ module rpgcards {
|
53
|
53
|
+ " and then triggers a series of hardcoded user actions,"
|
54
|
54
|
+ " in order to set up some application state that can be used"
|
55
|
55
|
+ " for testing");
|
|
56
|
+ var withDeckId = (i: number, fn: (deckId: string)=>void) => {
|
|
57
|
+ appStore.getDeckList().lift(ids => fn(ids[i]));
|
|
58
|
+ }
|
56
|
59
|
appActions.reset();
|
|
60
|
+
|
|
61
|
+ // Deck 1
|
57
|
62
|
appActions.newDeck();
|
58
|
|
- appStore.getDeckList().lift(deckIds => appActions.newCard(deckIds[0]));
|
59
|
|
- appStore.getDeckList().lift(deckIds => appActions.newCard(deckIds[0]));
|
|
63
|
+ withDeckId(0, id=>appActions.setDeckName(id, "Spells"));
|
|
64
|
+ withDeckId(0, id=>appActions.setDeckDesc(id, "This deck contains"
|
|
65
|
+ + " basic spells."));
|
|
66
|
+ withDeckId(0, id=>appActions.newCard(id));
|
|
67
|
+ withDeckId(0, id=>appActions.newCard(id));
|
|
68
|
+ withDeckId(0, id=>appActions.newCard(id));
|
|
69
|
+
|
|
70
|
+ // Deck 2
|
60
|
71
|
appActions.newDeck();
|
|
72
|
+ withDeckId(1, id=>appActions.setDeckName(id, "Items"));
|
|
73
|
+ withDeckId(1, id=>appActions.setDeckDesc(id, "This deck contains"
|
|
74
|
+ + " mundane and magic items."));
|
61
|
75
|
appStore.getDeckList().lift(deckIds => appActions.newCard(deckIds[1]));
|
|
76
|
+
|
|
77
|
+ // Deck 3
|
62
|
78
|
appActions.newDeck();
|
|
79
|
+ withDeckId(2, id=>appActions.setDeckName(id, "Creatures"));
|
|
80
|
+ withDeckId(2, id=>appActions.setDeckDesc(id, "This deck contains"
|
|
81
|
+ + " creatures."));
|
63
|
82
|
}
|
64
|
83
|
|
65
|
84
|
}
|