From 9d4c13bdd3868dfa8e01403786539c44f338e54f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enrique=20Jim=C3=A9nez?= Date: Tue, 16 Jan 2024 13:50:49 +0000 Subject: [PATCH] Add Magic to Corpus Genres --- src/corpus/ui/Corpus.tsx | 9 ++- .../Corpus.integration.test.ts.snap | 66 +++++++++++++++++++ .../__snapshots__/WordDisplay.test.tsx.snap | 36 ++++++++++ 3 files changed, 109 insertions(+), 2 deletions(-) diff --git a/src/corpus/ui/Corpus.tsx b/src/corpus/ui/Corpus.tsx index 76ca969de..e1b4e4acf 100644 --- a/src/corpus/ui/Corpus.tsx +++ b/src/corpus/ui/Corpus.tsx @@ -72,12 +72,12 @@ function Texts({ export function genreFromAbbr( abbr: string -): 'Literature' | 'Divination' | 'Medicine' { +): 'Literature' | 'Divination' | 'Medicine' | 'Magic' { const genre = genres.filter(({ genre }) => genre === abbr)[0] if (!genre) { throw new Error(`Genre Abbreviation '${abbr}' has to be one of L, D, Med.`) } - return genre.name as 'Literature' | 'Divination' | 'Medicine' + return genre.name as 'Literature' | 'Divination' | 'Medicine' | 'Magic' } export const genres: readonly { @@ -110,6 +110,11 @@ export const genres: readonly { name: 'Medicine', categories: ['', 'I. Nineveh Medical Encyclopaedia'], }, + { + genre: 'Mag', + name: 'Magic', + categories: ['', 'I. Anti-witchcraft'], + }, ] function Corpus({ diff --git a/src/corpus/ui/__snapshots__/Corpus.integration.test.ts.snap b/src/corpus/ui/__snapshots__/Corpus.integration.test.ts.snap index 2228923e3..15b9f4f62 100644 --- a/src/corpus/ui/__snapshots__/Corpus.integration.test.ts.snap +++ b/src/corpus/ui/__snapshots__/Corpus.integration.test.ts.snap @@ -237,6 +237,17 @@ exports[`With session 1`] = ` > Medicine + + Magic +
+
Medicine + + Magic +
+
Medicine + + Magic +
+