From fd2cbf25f5744a939ef6245809a1655e013a6420 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Sun, 10 Jan 2021 22:29:01 -0800 Subject: Start converting pref colors into themeProvider colors --- .../frost/injectors/ThemeProviderTest.kt | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 app/src/test/kotlin/com/pitchedapps/frost/injectors/ThemeProviderTest.kt (limited to 'app/src/test/kotlin/com/pitchedapps/frost/injectors/ThemeProviderTest.kt') diff --git a/app/src/test/kotlin/com/pitchedapps/frost/injectors/ThemeProviderTest.kt b/app/src/test/kotlin/com/pitchedapps/frost/injectors/ThemeProviderTest.kt new file mode 100644 index 00000000..f59980d2 --- /dev/null +++ b/app/src/test/kotlin/com/pitchedapps/frost/injectors/ThemeProviderTest.kt @@ -0,0 +1,32 @@ +/* + * Copyright 2019 Allan Wang + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.pitchedapps.frost.injectors + +import java.io.File +import kotlin.test.Test +import kotlin.test.assertTrue + +class ThemeProviderTest { + + @Test + fun verifyAssetsExist() { + ThemeProvider.values().forEach { asset -> + val file = File("src/web/assets/css/${asset.folder}/${asset.file}").absoluteFile + assertTrue(file.exists(), "${asset.name} not found at ${file.path}") + } + } +} -- cgit v1.2.3 From 8fe2427cff223a509441545227ac58b215903929 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Wed, 13 Jan 2021 00:32:09 -0800 Subject: Fix theme provider test --- .../com/pitchedapps/frost/injectors/ThemeProviderTest.kt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'app/src/test/kotlin/com/pitchedapps/frost/injectors/ThemeProviderTest.kt') diff --git a/app/src/test/kotlin/com/pitchedapps/frost/injectors/ThemeProviderTest.kt b/app/src/test/kotlin/com/pitchedapps/frost/injectors/ThemeProviderTest.kt index f59980d2..e1ef6225 100644 --- a/app/src/test/kotlin/com/pitchedapps/frost/injectors/ThemeProviderTest.kt +++ b/app/src/test/kotlin/com/pitchedapps/frost/injectors/ThemeProviderTest.kt @@ -16,6 +16,8 @@ */ package com.pitchedapps.frost.injectors +import com.pitchedapps.frost.enums.Theme +import com.pitchedapps.frost.enums.ThemeCategory import java.io.File import kotlin.test.Test import kotlin.test.assertTrue @@ -24,9 +26,11 @@ class ThemeProviderTest { @Test fun verifyAssetsExist() { - ThemeProvider.values().forEach { asset -> - val file = File("src/web/assets/css/${asset.folder}/${asset.file}").absoluteFile - assertTrue(file.exists(), "${asset.name} not found at ${file.path}") + ThemeCategory.values().forEach { category -> + Theme.values.filter { it != Theme.DEFAULT }.forEach { theme -> + val file = File("src/web/assets/css/${category.folder}/themes/${theme.file}").absoluteFile + assertTrue(file.exists(), "${theme.name} not found at ${file.path}") + } } } } -- cgit v1.2.3