File size: 1,401 Bytes
3e6248e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
"""
E2E Tests for Blink and Contact Endpoints

Tests miscellaneous endpoints.
"""
import pytest


class TestBlinkE2E:
    """Test /blink endpoint."""
    
    def test_blink_requires_auth(self, api_client):
        """Blink endpoint requires authentication."""
        response = api_client.get("/blink?userid=12345678901234567890test")
        
        # Blink is now protected by auth middleware
        assert response.status_code == 401
    
    def test_blink_post_requires_auth(self, api_client):
        """Blink POST requires authentication."""
        response = api_client.post("/blink", json={
            "page": "/test",
            "action": "click"
        })
        
        assert response.status_code == 401


class TestContactE2E:
    """Test /contact endpoint."""
    
    def test_contact_requires_auth(self, api_client):
        """Contact submission requires authentication."""
        response = api_client.post("/contact", json={
            "message": "Test message",
            "subject": "Test subject"
        })
        
        assert response.status_code == 401


class TestDatabaseE2E:
    """Test /api/data endpoint."""
    
    def test_data_requires_auth(self, api_client):
        """Data endpoint requires authentication."""
        response = api_client.get("/api/data")
        
        # Data endpoint is protected
        assert response.status_code == 401