Back to Tests

API autentifikatsiya testi

Passed

Test ID: test_2

Test Script

describe('API Auth Tests', () => {
  it('should login with valid credentials', async () => {
    const response = await fetch('/api/auth/login', {
      method: 'POST',
      body: JSON.stringify({
        email: 'test@example.com',
        password: 'secret123'
      })
    });
    
    expect(response.status).toBe(200);
    const data = await response.json();
    expect(data.token).toBeDefined();
  });

  it('should reject invalid credentials', async () => {
    const response = await fetch('/api/auth/login', {
      method: 'POST',
      body: JSON.stringify({
        email: 'wrong@email.com',
        password: 'wrongpass'
      })
    });
    
    expect(response.status).toBe(401);
  });
});

Execution History

Latest 4 execution runs

2026-08-23 14:30

Ali V. by

1.2sPassed

2026-08-23 11:15

Auto by

1.8sFailed

2026-08-22 16:45

Bekzod T. by

1.1sPassed

2026-08-22 09:20

Auto by

0.9sPassed

Test Specifications

Category
API
Last Executed
14:30, 2026-08-23
Avg Duration
1.25s
Success Ratio
92%
Created Date
2026-07-01
Author
Ali Valiyev

Tags

#auth#api#jwt#security#login