🐛Do not show anonymous user is the user list everywhere on UI (#182)

* 🐛Do not show anonymous user is the user list everywhere on UI
This commit is contained in:
Anton Shepilov
2023-09-01 15:56:56 +02:00
committed by GitHub
parent 1eb0df97f1
commit c77bdbf99d
7 changed files with 62 additions and 15 deletions
@@ -1,5 +1,5 @@
import { TestPlatform } from "./setup";
import User from "./../../src/services/user/entities/user";
import User, { UserType } from "./../../src/services/user/entities/user";
import Company, {
getInstance as getCompanyInstance,
} from "./../../src/services/user/entities/company";
@@ -128,6 +128,8 @@ export class TestDbService {
username?: string;
password?: string;
cache?: User["cache"];
identity_provider?: string;
type?: UserType;
} = {},
id: string = uuidv1(),
): Promise<User> {
@@ -140,6 +142,8 @@ export class TestDbService {
user.email_canonical = options.email || `test${random}@tdrive.app`;
user.identity_provider_id = user.id;
user.cache = options.cache || user.cache || { companies: [] };
user.identity_provider = options.identity_provider || "console";
user.type = options.type || "regular";
//Fixme this is cheating, we should correctly set the cache in internal mode in the code
user.cache.companies = [