diff --git a/components/ui/__tests__/Settings.spec.tsx b/components/ui/__tests__/Settings.spec.tsx index ee1cd9c..e2711a3 100644 --- a/components/ui/__tests__/Settings.spec.tsx +++ b/components/ui/__tests__/Settings.spec.tsx @@ -41,6 +41,7 @@ jest.mock("@/app/i18n/api", () => { }; }); + describe("SettingsComponent", () => { let db: Knex; let settings: Settings; @@ -48,16 +49,18 @@ describe("SettingsComponent", () => { beforeEach(async () => { db = await getDb("development"); settings = new Settings(db); + jest.spyOn(Settings, 'getDefault').mockResolvedValue(settings); await settings.setHostLanguage("en"); await settings.setLibretranslateBaseUrl("https://example.com"); }); afterEach(async () => { + jest.restoreAllMocks(); await db.migrate.down(); await db.destroy(); }); - beforeAll(() => { + beforeAll(async () => { jest.useFakeTimers(); }); diff --git a/package-lock.json b/package-lock.json index 3fe5e0a..c734d3b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -31,7 +31,6 @@ "expo-screen-orientation": "~8.0.4", "expo-sharing": "^13.0.1", "expo-splash-screen": "~0.29.21", - "expo-sqlite": "~15.1.2", "expo-status-bar": "~2.0.1", "expo-symbols": "~0.2.2", "expo-system-ui": "~4.0.7", @@ -49,6 +48,7 @@ "react-native-sqlite-storage": "^6.0.1", "react-native-web": "~0.19.13", "react-native-webview": "13.12.5", + "sqlite": "^5.1.1", "sqlite3": "^5.1.7", "whisper.rn": "^0.3.9" }, @@ -8695,6 +8695,7 @@ "resolved": "https://registry.npmjs.org/expo-sqlite/-/expo-sqlite-15.1.2.tgz", "integrity": "sha512-xe+v56ts6GWJoNXLpWBQJmIPd7K1Bk9tmWc2b0nV5yUjqXZX3lbTYm8QhXEqUJxYu87o2GSkNqAqNKeDbMUXGQ==", "license": "MIT", + "peer": true, "peerDependencies": { "expo": "*", "react": "*", @@ -16483,6 +16484,12 @@ "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", "license": "BSD-3-Clause" }, + "node_modules/sqlite": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/sqlite/-/sqlite-5.1.1.tgz", + "integrity": "sha512-oBkezXa2hnkfuJwUo44Hl9hS3er+YFtueifoajrgidvqsJRQFpc5fKoAkAor1O5ZnLoa28GBScfHXs8j0K358Q==", + "license": "MIT" + }, "node_modules/sqlite3": { "version": "5.1.7", "resolved": "https://registry.npmjs.org/sqlite3/-/sqlite3-5.1.7.tgz", diff --git a/package.json b/package.json index 3bec29c..a8224dd 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,6 @@ "expo-screen-orientation": "~8.0.4", "expo-sharing": "^13.0.1", "expo-splash-screen": "~0.29.21", - "expo-sqlite": "~15.1.2", "expo-status-bar": "~2.0.1", "expo-symbols": "~0.2.2", "expo-system-ui": "~4.0.7", @@ -56,6 +55,7 @@ "react-native-sqlite-storage": "^6.0.1", "react-native-web": "~0.19.13", "react-native-webview": "13.12.5", + "sqlite": "^5.1.1", "sqlite3": "^5.1.7", "whisper.rn": "^0.3.9" }, diff --git a/translation_terrace.db b/translation_terrace.db index b7b6f60..6b3da6c 100644 Binary files a/translation_terrace.db and b/translation_terrace.db differ