fix: create new accounts with DISCONNECTED status so QR displays immediately

This commit is contained in:
2026-05-29 11:57:42 +05:30
parent afff6fdbdf
commit 801c1d7121
2 changed files with 4 additions and 4 deletions
@@ -17,7 +17,7 @@ const mockCreatedAccount = {
platform: 'whatsapp',
jid: 'pending_uuid@placeholder',
displayName: 'My Number',
status: 'ACTIVE',
status: 'DISCONNECTED',
};
const mockPrisma = {
@@ -82,13 +82,13 @@ describe('AccountsService', () => {
});
describe('create()', () => {
it('creates account with platform whatsapp and status ACTIVE', async () => {
it('creates account with platform whatsapp and status DISCONNECTED', async () => {
await service.create('My Number');
expect(mockPrisma.account.create).toHaveBeenCalledWith(
expect.objectContaining({
data: expect.objectContaining({
platform: 'whatsapp',
status: 'ACTIVE',
status: 'DISCONNECTED',
displayName: 'My Number',
}),
}),
@@ -51,7 +51,7 @@ export class AccountsService {
jid: `pending_${uid}@placeholder`,
sessionPath: `${sessionBase}/${uid}`,
displayName: displayName ?? null,
status: 'ACTIVE',
status: 'DISCONNECTED',
},
select: { id: true, platform: true, jid: true, displayName: true, status: true },
});