From c5d2d7ca77a502ea607d2db5ecdec972bc76bc69 Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Tue, 3 Jan 2023 23:51:00 +0100 Subject: Fixed fixtures and testing --- fixtures.js | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'fixtures.js') diff --git a/fixtures.js b/fixtures.js index bfc6b3c..f036f01 100644 --- a/fixtures.js +++ b/fixtures.js @@ -1,4 +1,23 @@ -import {createUser} from "./database/users.js"; +import { newGame } from './database/games.js'; +import { createUser } from './database/users.js'; +import { emptyBoard } from './utils/board.js'; -createUser("Alice", "Alice42!", "alice@example.com"); -createUser("Bob", "Bob42!", "bob@example.com"); +await createUser('Alice', 'Alice42!', 'alice@example.com'); +await createUser('Bob', 'Bob42!', 'bob@example.com'); +const data = { + board: emptyBoard, + name: 'Alice vs Bob', + player1: { + id: 1, + username: 'Alice', + score: 0, + letters: ['A', 'B', 'C', 'D', 'E', 'F', 'G'], + }, + player2: { + id: 2, + username: 'Bob', + score: 0, + letters: ['T', 'U', 'V', 'W', 'X', 'Y', 'Z'], + }, +}; +newGame(1, 2, data); -- cgit v1.2.3