AppFlowy/frontend/appflowy_tauri/src/tests/user.test.ts
Lucas.Xu 668e1196d1
chore: config tauri web driver test (#1947)
* chore: setup tauri test

* chore: update test

* chore: update test

* chore: update test

* chore: update test

* refactor: test folder location

* chore: remove deps

* ci: fix build

---------

Co-authored-by: appflowy <annie@appflowy.io>
Co-authored-by: nathan <nathan@appflowy.io>
2023-03-11 13:07:31 +08:00

44 lines
1.4 KiB
TypeScript

export {}
// import { AuthBackendService, UserBackendService } from '../appflowy_app/stores/effects/user/user_bd_svc';
// import { randomFillSync } from 'crypto';
// import { nanoid } from '@reduxjs/toolkit';
// beforeAll(() => {
// //@ts-ignore
// window.crypto = {
// // @ts-ignore
// getRandomValues: function (buffer) {
// // @ts-ignore
// return randomFillSync(buffer);
// },
// };
// });
// describe('User backend service', () => {
// it('sign up', async () => {
// const service = new AuthBackendService();
// const result = await service.autoSignUp();
// expect(result.ok).toBeTruthy;
// });
// it('sign in', async () => {
// const authService = new AuthBackendService();
// const email = nanoid(4) + '@appflowy.io';
// const password = nanoid(10);
// const signUpResult = await authService.signUp({ name: 'nathan', email: email, password: password });
// expect(signUpResult.ok).toBeTruthy;
// const signInResult = await authService.signIn({ email: email, password: password });
// expect(signInResult.ok).toBeTruthy;
// });
// it('get user profile', async () => {
// const service = new AuthBackendService();
// const result = await service.autoSignUp();
// const userProfile = result.unwrap();
// const userService = new UserBackendService(userProfile.id);
// expect((await userService.getUserProfile()).unwrap()).toBe(userProfile);
// });
// });