Skip to content

Instantly share code, notes, and snippets.

@YonatanKra
Created September 23, 2023 19:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save YonatanKra/935b115d580ad10d9e9e7fd8ca9dc6eb to your computer and use it in GitHub Desktop.
Save YonatanKra/935b115d580ad10d9e9e7fd8ca9dc6eb to your computer and use it in GitHub Desktop.
Tauri-demo: call signInWithEmailAndPassword with email and password
it('should call `signInWithEmailAndPassword` with auth, email and password', async () => {
const email = 't@t.com';
const password = '123456';
const firebaseAuth = await import('firebase/auth');
await auth.login(email, password);
expect(firebaseAuth.signInWithEmailAndPassword).toHaveBeenCalledWith(firebaseAuth.getAuth(), email, password);
});
async login(email: string, password: string) {
await signInWithEmailAndPassword(getAuth(), email, password);
this.dispatchEvent(new CustomEvent('user-status-change'));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment