mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-06 02:34:21 +00:00
style(server): format the files the health lanes added or moved
Prettier on every new or moved file that was not formatted, so lint:format holds them; the files taken off the format baseline are the ones that moved or were formatted on the way.
This commit is contained in:
@@ -4,17 +4,18 @@
|
||||
* UsersRepository; the Immich cases moved here with their methods, and the rest
|
||||
* pin each statement's columns and its missing-user branch.
|
||||
*/
|
||||
import { afterAll, beforeAll, beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import { createSnapshotTestDb } from '../../../helpers/db-mock';
|
||||
import { resetTestDb } from '../../../helpers/test-db';
|
||||
import { createTestOrm, type TestOrm } from '../../../helpers/test-orm';
|
||||
import { createUser } from '../../../helpers/factories';
|
||||
import { Users } from '../../../../src/db/entities/Users.entity';
|
||||
import { updateRows } from '../../../helpers/factories/rows';
|
||||
import { readUser } from '../../../helpers/factories/users';
|
||||
import { UserAirtrailRepository } from '../../../../src/db/repositories/UserAirtrail.repository';
|
||||
import { UserImmichRepository } from '../../../../src/db/repositories/UserImmich.repository';
|
||||
import { UserSynologyRepository } from '../../../../src/db/repositories/UserSynology.repository';
|
||||
import { UserAirtrailRepository } from '../../../../src/db/repositories/UserAirtrail.repository';
|
||||
import { createSnapshotTestDb } from '../../../helpers/db-mock';
|
||||
import { createUser } from '../../../helpers/factories';
|
||||
import { updateRows } from '../../../helpers/factories/rows';
|
||||
import { readUser } from '../../../helpers/factories/users';
|
||||
import { resetTestDb } from '../../../helpers/test-db';
|
||||
import { createTestOrm, type TestOrm } from '../../../helpers/test-orm';
|
||||
|
||||
import { afterAll, beforeAll, beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
|
||||
const testDb = createSnapshotTestDb();
|
||||
let t: TestOrm;
|
||||
@@ -28,8 +29,14 @@ beforeAll(async () => {
|
||||
synology = new UserSynologyRepository(t.orm.em);
|
||||
airtrail = new UserAirtrailRepository(t.orm.em);
|
||||
});
|
||||
beforeEach(() => { resetTestDb(testDb); t.clear(); });
|
||||
afterAll(async () => { await t.close(); testDb.close(); });
|
||||
beforeEach(() => {
|
||||
resetTestDb(testDb);
|
||||
t.clear();
|
||||
});
|
||||
afterAll(async () => {
|
||||
await t.close();
|
||||
testDb.close();
|
||||
});
|
||||
|
||||
/** Counts the queries MikroORM issues over the shared connection while `fn` runs. */
|
||||
async function withQueryCount<T>(fn: () => Promise<T>): Promise<{ value: T; queries: number }> {
|
||||
@@ -53,7 +60,17 @@ describe('UserImmichRepository — reads', () => {
|
||||
|
||||
it('M1b: getImmichCredentials / getImmichConnectionPrefs carry immich_allow_insecure_tls (#2475), and the missing-user branch', async () => {
|
||||
const { user } = createUser(testDb);
|
||||
await updateRows(t, Users, { id: user.id }, { immich_url: 'https://immich.test', immich_api_key: 'key-1', immich_auto_upload: 1, immich_allow_insecure_tls: 1 });
|
||||
await updateRows(
|
||||
t,
|
||||
Users,
|
||||
{ id: user.id },
|
||||
{
|
||||
immich_url: 'https://immich.test',
|
||||
immich_api_key: 'key-1',
|
||||
immich_auto_upload: 1,
|
||||
immich_allow_insecure_tls: 1,
|
||||
},
|
||||
);
|
||||
|
||||
expect(await immich.getImmichCredentials(user.id)).toEqual({
|
||||
immich_url: 'https://immich.test',
|
||||
@@ -62,7 +79,10 @@ describe('UserImmichRepository — reads', () => {
|
||||
});
|
||||
expect(await immich.getImmichCredentials(999999)).toBeNull();
|
||||
|
||||
expect(await immich.getImmichConnectionPrefs(user.id)).toEqual({ immich_auto_upload: 1, immich_allow_insecure_tls: 1 });
|
||||
expect(await immich.getImmichConnectionPrefs(user.id)).toEqual({
|
||||
immich_auto_upload: 1,
|
||||
immich_allow_insecure_tls: 1,
|
||||
});
|
||||
expect(await immich.getImmichConnectionPrefs(999999)).toBeNull();
|
||||
});
|
||||
});
|
||||
@@ -76,17 +96,28 @@ describe('UserImmichRepository — Immich settings write (IM4/IM5)', () => {
|
||||
const read = async (id: number) => {
|
||||
const row = await readUser(t, id);
|
||||
return {
|
||||
immich_url: row.immich_url, immich_api_key: row.immich_api_key, immich_allow_insecure_tls: row.immich_allow_insecure_tls,
|
||||
immich_url: row.immich_url,
|
||||
immich_api_key: row.immich_api_key,
|
||||
immich_allow_insecure_tls: row.immich_allow_insecure_tls,
|
||||
};
|
||||
};
|
||||
|
||||
it('USERSREPO-085 (IM4): setImmichSettings keeps the stored switch on a null value while the URL stays the same, and starts a new URL off', async () => {
|
||||
const { user } = createUser(testDb);
|
||||
await updateRows(t, Users, { id: user.id }, { immich_url: 'https://nas.local', immich_api_key: 'enc-old', immich_allow_insecure_tls: 1 });
|
||||
await updateRows(
|
||||
t,
|
||||
Users,
|
||||
{ id: user.id },
|
||||
{ immich_url: 'https://nas.local', immich_api_key: 'enc-old', immich_allow_insecure_tls: 1 },
|
||||
);
|
||||
|
||||
// An older client that does not know the switch cannot clear it by saving.
|
||||
await immich.setImmichSettings(user.id, 'https://nas.local', 'enc-new', null);
|
||||
expect(await read(user.id)).toEqual({ immich_url: 'https://nas.local', immich_api_key: 'enc-new', immich_allow_insecure_tls: 1 });
|
||||
expect(await read(user.id)).toEqual({
|
||||
immich_url: 'https://nas.local',
|
||||
immich_api_key: 'enc-new',
|
||||
immich_allow_insecure_tls: 1,
|
||||
});
|
||||
|
||||
// Sent explicitly, the value wins over the stored one.
|
||||
await immich.setImmichSettings(user.id, 'https://nas.local', 'enc-new', 0);
|
||||
@@ -96,15 +127,27 @@ describe('UserImmichRepository — Immich settings write (IM4/IM5)', () => {
|
||||
|
||||
// The switch trusts one server: another URL without it starts off ...
|
||||
await immich.setImmichSettings(user.id, 'https://photos.example.com', 'enc-2', null);
|
||||
expect(await read(user.id)).toEqual({ immich_url: 'https://photos.example.com', immich_api_key: 'enc-2', immich_allow_insecure_tls: 0 });
|
||||
expect(await read(user.id)).toEqual({
|
||||
immich_url: 'https://photos.example.com',
|
||||
immich_api_key: 'enc-2',
|
||||
immich_allow_insecure_tls: 0,
|
||||
});
|
||||
// ... and with it, holds for that server.
|
||||
await immich.setImmichSettings(user.id, 'https://other.example.com', 'enc-3', 1);
|
||||
expect(await read(user.id)).toEqual({ immich_url: 'https://other.example.com', immich_api_key: 'enc-3', immich_allow_insecure_tls: 1 });
|
||||
expect(await read(user.id)).toEqual({
|
||||
immich_url: 'https://other.example.com',
|
||||
immich_api_key: 'enc-3',
|
||||
immich_allow_insecure_tls: 1,
|
||||
});
|
||||
|
||||
// A first connection (no stored URL) without the switch starts off too.
|
||||
await updateRows(t, Users, { id: user.id }, { immich_url: null, immich_allow_insecure_tls: 1 });
|
||||
await immich.setImmichSettings(user.id, 'https://nas.local', 'enc-4', null);
|
||||
expect(await read(user.id)).toEqual({ immich_url: 'https://nas.local', immich_api_key: 'enc-4', immich_allow_insecure_tls: 0 });
|
||||
expect(await read(user.id)).toEqual({
|
||||
immich_url: 'https://nas.local',
|
||||
immich_api_key: 'enc-4',
|
||||
immich_allow_insecure_tls: 0,
|
||||
});
|
||||
});
|
||||
|
||||
it('USERSREPO-086 (IM4): setImmichSettings matches the legacy CASE statement across every (stored url, stored switch, new url, value) combination, in ONE statement', async () => {
|
||||
@@ -119,11 +162,21 @@ describe('UserImmichRepository — Immich settings write (IM4/IM5)', () => {
|
||||
for (const storedFlag of [0, 1]) {
|
||||
for (const newUrl of ['https://nas.local', 'https://photos.example.com']) {
|
||||
for (const value of [null, 0, 1]) {
|
||||
await updateRows(t, Users, { id: user.id }, { immich_url: storedUrl, immich_api_key: null, immich_allow_insecure_tls: storedFlag });
|
||||
await updateRows(
|
||||
t,
|
||||
Users,
|
||||
{ id: user.id },
|
||||
{ immich_url: storedUrl, immich_api_key: null, immich_allow_insecure_tls: storedFlag },
|
||||
);
|
||||
legacy.run(newUrl, 'enc-key', newUrl, value, value, user.id);
|
||||
const expected = await read(user.id);
|
||||
|
||||
await updateRows(t, Users, { id: user.id }, { immich_url: storedUrl, immich_api_key: null, immich_allow_insecure_tls: storedFlag });
|
||||
await updateRows(
|
||||
t,
|
||||
Users,
|
||||
{ id: user.id },
|
||||
{ immich_url: storedUrl, immich_api_key: null, immich_allow_insecure_tls: storedFlag },
|
||||
);
|
||||
const { queries } = await withQueryCount(() => immich.setImmichSettings(user.id, newUrl, 'enc-key', value));
|
||||
expect(queries).toBe(1);
|
||||
expect(await read(user.id)).toEqual(expected);
|
||||
@@ -135,7 +188,12 @@ describe('UserImmichRepository — Immich settings write (IM4/IM5)', () => {
|
||||
|
||||
it('USERSREPO-087 (IM5): clearImmichSettings nulls the URL, stores the key it is handed and always turns the switch off', async () => {
|
||||
const { user } = createUser(testDb);
|
||||
await updateRows(t, Users, { id: user.id }, { immich_url: 'https://nas.local', immich_api_key: 'enc-old', immich_allow_insecure_tls: 1 });
|
||||
await updateRows(
|
||||
t,
|
||||
Users,
|
||||
{ id: user.id },
|
||||
{ immich_url: 'https://nas.local', immich_api_key: 'enc-old', immich_allow_insecure_tls: 1 },
|
||||
);
|
||||
await immich.clearImmichSettings(user.id, null);
|
||||
expect(await read(user.id)).toEqual({ immich_url: null, immich_api_key: null, immich_allow_insecure_tls: 0 });
|
||||
});
|
||||
@@ -144,13 +202,35 @@ describe('UserImmichRepository — Immich settings write (IM4/IM5)', () => {
|
||||
describe('UserSynologyRepository', () => {
|
||||
it('SYNOREPO-001: getSynologyFields reads only the asked columns, and null for a missing user', async () => {
|
||||
const { user } = createUser(testDb);
|
||||
await updateRows(t, Users, { id: user.id }, {
|
||||
synology_url: 'https://nas:5001/photo', synology_username: 'syno-login', synology_password: 'enc-pw',
|
||||
synology_sid: 'sid-1', synology_did: 'did-1', synology_skip_ssl: 1,
|
||||
await updateRows(
|
||||
t,
|
||||
Users,
|
||||
{ id: user.id },
|
||||
{
|
||||
synology_url: 'https://nas:5001/photo',
|
||||
synology_username: 'syno-login',
|
||||
synology_password: 'enc-pw',
|
||||
synology_sid: 'sid-1',
|
||||
synology_did: 'did-1',
|
||||
synology_skip_ssl: 1,
|
||||
},
|
||||
);
|
||||
expect(await synology.getSynologyFields(user.id, ['synology_url', 'synology_sid'])).toEqual({
|
||||
synology_url: 'https://nas:5001/photo',
|
||||
synology_sid: 'sid-1',
|
||||
});
|
||||
expect(await synology.getSynologyFields(user.id, ['synology_url', 'synology_sid'])).toEqual({ synology_url: 'https://nas:5001/photo', synology_sid: 'sid-1' });
|
||||
expect(await synology.getSynologyFields(user.id, ['synology_username', 'synology_password', 'synology_did', 'synology_skip_ssl'])).toEqual({
|
||||
synology_username: 'syno-login', synology_password: 'enc-pw', synology_did: 'did-1', synology_skip_ssl: 1,
|
||||
expect(
|
||||
await synology.getSynologyFields(user.id, [
|
||||
'synology_username',
|
||||
'synology_password',
|
||||
'synology_did',
|
||||
'synology_skip_ssl',
|
||||
]),
|
||||
).toEqual({
|
||||
synology_username: 'syno-login',
|
||||
synology_password: 'enc-pw',
|
||||
synology_did: 'did-1',
|
||||
synology_skip_ssl: 1,
|
||||
});
|
||||
expect(await synology.getSynologyFields(999999, ['synology_url'])).toBeNull();
|
||||
});
|
||||
@@ -182,7 +262,12 @@ describe('UserSynologyRepository', () => {
|
||||
const { user } = createUser(testDb);
|
||||
await synology.setSynologySettings(user.id, 'https://nas', 'me', 'enc', 1);
|
||||
const row = await readUser(t, user.id);
|
||||
expect([row.synology_url, row.synology_username, row.synology_password, row.synology_skip_ssl]).toEqual(['https://nas', 'me', 'enc', 1]);
|
||||
expect([row.synology_url, row.synology_username, row.synology_password, row.synology_skip_ssl]).toEqual([
|
||||
'https://nas',
|
||||
'me',
|
||||
'enc',
|
||||
1,
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -190,15 +275,32 @@ describe('UserAirtrailRepository', () => {
|
||||
const read = async (id: number) => {
|
||||
const row = await readUser(t, id);
|
||||
return {
|
||||
airtrail_url: row.airtrail_url, airtrail_api_key: row.airtrail_api_key,
|
||||
airtrail_allow_insecure_tls: row.airtrail_allow_insecure_tls, airtrail_write_enabled: row.airtrail_write_enabled,
|
||||
airtrail_url: row.airtrail_url,
|
||||
airtrail_api_key: row.airtrail_api_key,
|
||||
airtrail_allow_insecure_tls: row.airtrail_allow_insecure_tls,
|
||||
airtrail_write_enabled: row.airtrail_write_enabled,
|
||||
};
|
||||
};
|
||||
|
||||
it('AIRTRAILREPO-001: getAirtrailConnRow and getAirtrailWriteEnabled read the connection, and null for a missing user', async () => {
|
||||
const { user } = createUser(testDb);
|
||||
await updateRows(t, Users, { id: user.id }, { airtrail_url: 'https://at', airtrail_api_key: 'enc', airtrail_allow_insecure_tls: 1, airtrail_write_enabled: 1 });
|
||||
expect(await airtrail.getAirtrailConnRow(user.id)).toEqual({ airtrail_url: 'https://at', airtrail_api_key: 'enc', airtrail_allow_insecure_tls: 1, airtrail_write_enabled: 1 });
|
||||
await updateRows(
|
||||
t,
|
||||
Users,
|
||||
{ id: user.id },
|
||||
{
|
||||
airtrail_url: 'https://at',
|
||||
airtrail_api_key: 'enc',
|
||||
airtrail_allow_insecure_tls: 1,
|
||||
airtrail_write_enabled: 1,
|
||||
},
|
||||
);
|
||||
expect(await airtrail.getAirtrailConnRow(user.id)).toEqual({
|
||||
airtrail_url: 'https://at',
|
||||
airtrail_api_key: 'enc',
|
||||
airtrail_allow_insecure_tls: 1,
|
||||
airtrail_write_enabled: 1,
|
||||
});
|
||||
expect(await airtrail.getAirtrailConnRow(999999)).toBeNull();
|
||||
expect(await airtrail.getAirtrailWriteEnabled(user.id)).toBe(1);
|
||||
expect(await airtrail.getAirtrailWriteEnabled(999999)).toBeNull();
|
||||
@@ -207,9 +309,19 @@ describe('UserAirtrailRepository', () => {
|
||||
it('AIRTRAILREPO-002: the settings writes, with and without a new key, and the key scrub', async () => {
|
||||
const { user } = createUser(testDb);
|
||||
await airtrail.setAirtrailSettingsWithKey(user.id, 'https://at', 'enc-1', 0, 1);
|
||||
expect(await read(user.id)).toEqual({ airtrail_url: 'https://at', airtrail_api_key: 'enc-1', airtrail_allow_insecure_tls: 0, airtrail_write_enabled: 1 });
|
||||
expect(await read(user.id)).toEqual({
|
||||
airtrail_url: 'https://at',
|
||||
airtrail_api_key: 'enc-1',
|
||||
airtrail_allow_insecure_tls: 0,
|
||||
airtrail_write_enabled: 1,
|
||||
});
|
||||
await airtrail.setAirtrailSettings(user.id, 'https://at2', 1, 0);
|
||||
expect(await read(user.id)).toEqual({ airtrail_url: 'https://at2', airtrail_api_key: 'enc-1', airtrail_allow_insecure_tls: 1, airtrail_write_enabled: 0 });
|
||||
expect(await read(user.id)).toEqual({
|
||||
airtrail_url: 'https://at2',
|
||||
airtrail_api_key: 'enc-1',
|
||||
airtrail_allow_insecure_tls: 1,
|
||||
airtrail_write_enabled: 0,
|
||||
});
|
||||
await airtrail.clearAirtrailApiKey(user.id);
|
||||
expect((await read(user.id)).airtrail_api_key).toBeNull();
|
||||
});
|
||||
|
||||
@@ -4,11 +4,19 @@
|
||||
* canonical `YYYY-MM-DD HH:MM:SS` text; canonical values, NULLs and anything
|
||||
* not in the full ISO shape stay as they are, and a second run changes nothing.
|
||||
*/
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { createMigrationOrm, migrateTo, pendingNames, rawExec, rawQuery, runMigrationDirect } from '../../helpers/migration-step';
|
||||
import { Migration20200101042700_timestamps_stored_in_one_spelling } from '../../../src/db/migrations/Migration20200101042700_timestamps_stored_in_one_spelling';
|
||||
import {
|
||||
createMigrationOrm,
|
||||
migrateTo,
|
||||
pendingNames,
|
||||
rawExec,
|
||||
rawQuery,
|
||||
runMigrationDirect,
|
||||
} from '../../helpers/migration-step';
|
||||
import type { MikroORM } from '@mikro-orm/sqlite';
|
||||
|
||||
import { describe, expect, it } from 'vitest';
|
||||
|
||||
const TARGET = 'Migration20200101042700_timestamps_stored_in_one_spelling';
|
||||
|
||||
async function ormBeforeTarget(): Promise<MikroORM> {
|
||||
@@ -22,16 +30,31 @@ async function ormBeforeTarget(): Promise<MikroORM> {
|
||||
|
||||
async function seed(orm: MikroORM): Promise<void> {
|
||||
await rawExec(orm, "INSERT INTO users (id, username, email, password_hash) VALUES (1, 'owner', 'owner@test', 'x')");
|
||||
await rawExec(orm, "INSERT INTO collections (id, owner_id, name, updated_at) VALUES (1, 1, 'iso', '2026-03-04T05:06:07.890Z')");
|
||||
await rawExec(orm, "INSERT INTO collections (id, owner_id, name, updated_at) VALUES (2, 1, 'canonical', '2026-03-04 05:06:07')");
|
||||
await rawExec(
|
||||
orm,
|
||||
"INSERT INTO collections (id, owner_id, name, updated_at) VALUES (1, 1, 'iso', '2026-03-04T05:06:07.890Z')",
|
||||
);
|
||||
await rawExec(
|
||||
orm,
|
||||
"INSERT INTO collections (id, owner_id, name, updated_at) VALUES (2, 1, 'canonical', '2026-03-04 05:06:07')",
|
||||
);
|
||||
await rawExec(orm, "INSERT INTO collections (id, owner_id, name, updated_at) VALUES (3, 1, 'null', NULL)");
|
||||
await rawExec(orm, "INSERT INTO collections (id, owner_id, name, updated_at) VALUES (4, 1, 'offset', '2026-03-04T05:06:07+02:00')");
|
||||
await rawExec(orm, "INSERT INTO collections (id, owner_id, name, updated_at) VALUES (5, 1, 'no-millis', '2026-03-04T05:06:07Z')");
|
||||
await rawExec(
|
||||
orm,
|
||||
"INSERT INTO collections (id, owner_id, name, updated_at) VALUES (4, 1, 'offset', '2026-03-04T05:06:07+02:00')",
|
||||
);
|
||||
await rawExec(
|
||||
orm,
|
||||
"INSERT INTO collections (id, owner_id, name, updated_at) VALUES (5, 1, 'no-millis', '2026-03-04T05:06:07Z')",
|
||||
);
|
||||
await rawExec(
|
||||
orm,
|
||||
"INSERT INTO password_reset_tokens (id, user_id, token_hash, expires_at) VALUES (1, 1, 'h1', '2026-05-06T07:08:09.123Z'), (2, 1, 'h2', '2026-05-06 07:08:09')",
|
||||
);
|
||||
await rawExec(orm, "INSERT INTO oauth_clients (id, name, client_id, client_secret_hash) VALUES ('c', 'Client', 'cid', 'x')");
|
||||
await rawExec(
|
||||
orm,
|
||||
"INSERT INTO oauth_clients (id, name, client_id, client_secret_hash) VALUES ('c', 'Client', 'cid', 'x')",
|
||||
);
|
||||
await rawExec(
|
||||
orm,
|
||||
`INSERT INTO oauth_tokens (id, client_id, user_id, access_token_hash, refresh_token_hash, access_token_expires_at, refresh_token_expires_at)
|
||||
@@ -43,7 +66,10 @@ async function seed(orm: MikroORM): Promise<void> {
|
||||
const read = async (orm: MikroORM) => ({
|
||||
collections: await rawQuery(orm, 'SELECT id, updated_at FROM collections ORDER BY id'),
|
||||
resets: await rawQuery(orm, 'SELECT id, expires_at FROM password_reset_tokens ORDER BY id'),
|
||||
tokens: await rawQuery(orm, 'SELECT id, access_token_expires_at, refresh_token_expires_at FROM oauth_tokens ORDER BY id'),
|
||||
tokens: await rawQuery(
|
||||
orm,
|
||||
'SELECT id, access_token_expires_at, refresh_token_expires_at FROM oauth_tokens ORDER BY id',
|
||||
),
|
||||
});
|
||||
|
||||
const EXPECTED = {
|
||||
|
||||
@@ -6,14 +6,17 @@
|
||||
* a repository of their own, and pins which columns each connection repository
|
||||
* is about, so a statement on another column does not drift into it.
|
||||
*/
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { UsersRepository } from '../../../src/db/repositories/Users.repository';
|
||||
import { UserAirtrailRepository } from '../../../src/db/repositories/UserAirtrail.repository';
|
||||
import { UserImmichRepository } from '../../../src/db/repositories/UserImmich.repository';
|
||||
import { UserSynologyRepository } from '../../../src/db/repositories/UserSynology.repository';
|
||||
import { UserAirtrailRepository } from '../../../src/db/repositories/UserAirtrail.repository';
|
||||
import { UsersRepository } from '../../../src/db/repositories/Users.repository';
|
||||
|
||||
import { describe, expect, it } from 'vitest';
|
||||
|
||||
const ownMethods = (cls: { prototype: object }) =>
|
||||
Object.getOwnPropertyNames(cls.prototype).filter((name) => name !== 'constructor').sort();
|
||||
Object.getOwnPropertyNames(cls.prototype)
|
||||
.filter((name) => name !== 'constructor')
|
||||
.sort();
|
||||
|
||||
describe('the users repositories', () => {
|
||||
it('USERSHAPE-001: UsersRepository holds no more methods than it does today', () => {
|
||||
@@ -26,14 +29,29 @@ describe('the users repositories', () => {
|
||||
});
|
||||
|
||||
it('USERSHAPE-003: each connection repository holds its own statements', () => {
|
||||
expect(ownMethods(UserImmichRepository)).toEqual(
|
||||
['clearImmichSettings', 'getImmichAutoUpload', 'getImmichConnectionPrefs', 'getImmichCredentials', 'setImmichAutoUpload', 'setImmichSettings'],
|
||||
);
|
||||
expect(ownMethods(UserSynologyRepository)).toEqual(
|
||||
['clearSynologySID', 'clearSynologySession', 'getSynologyFields', 'getSynologyUsername', 'setSynologyDid', 'setSynologySettings', 'setSynologySid'],
|
||||
);
|
||||
expect(ownMethods(UserAirtrailRepository)).toEqual(
|
||||
['clearAirtrailApiKey', 'getAirtrailConnRow', 'getAirtrailWriteEnabled', 'setAirtrailSettings', 'setAirtrailSettingsWithKey'],
|
||||
);
|
||||
expect(ownMethods(UserImmichRepository)).toEqual([
|
||||
'clearImmichSettings',
|
||||
'getImmichAutoUpload',
|
||||
'getImmichConnectionPrefs',
|
||||
'getImmichCredentials',
|
||||
'setImmichAutoUpload',
|
||||
'setImmichSettings',
|
||||
]);
|
||||
expect(ownMethods(UserSynologyRepository)).toEqual([
|
||||
'clearSynologySID',
|
||||
'clearSynologySession',
|
||||
'getSynologyFields',
|
||||
'getSynologyUsername',
|
||||
'setSynologyDid',
|
||||
'setSynologySettings',
|
||||
'setSynologySid',
|
||||
]);
|
||||
expect(ownMethods(UserAirtrailRepository)).toEqual([
|
||||
'clearAirtrailApiKey',
|
||||
'getAirtrailConnRow',
|
||||
'getAirtrailWriteEnabled',
|
||||
'setAirtrailSettings',
|
||||
'setAirtrailSettingsWithKey',
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user