Add e2e seed and test event creation

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2019-10-12 13:16:36 +02:00
parent 6afde20b96
commit 5e75daa732
16 changed files with 237 additions and 30 deletions

View File

@@ -37,6 +37,8 @@ export function deleteUserData() {
}
}
export class NoIdentitiesException extends Error {}
/**
* We fetch from localStorage the latest actor ID used,
* then fetch the current identities to set in cache
@@ -50,7 +52,10 @@ export async function initializeCurrentActor(apollo: ApolloClient<any>) {
fetchPolicy: 'network-only',
});
const identities = result.data.identities;
if (identities.length < 1) return;
if (identities.length < 1) {
console.warn('Logged user has no identities!');
throw new NoIdentitiesException;
}
const activeIdentity = identities.find(identity => identity.id === actorId) || identities[0] as IPerson;
if (activeIdentity) {