Browse Source

update code

yb 3 ngày trước cách đây
mục cha
commit
82dc1956b4
1 tập tin đã thay đổi với 6 bổ sung6 xóa
  1. 6 6
      tests/unit/api/camera.spec.ts

+ 6 - 6
tests/unit/api/camera.spec.ts

@@ -48,14 +48,14 @@ describe('Camera API', () => {
     })
 
     describe('getCamera', () => {
-      it('should call GET /camera/:id', async () => {
+      it('should call GET /camera/control/:id', async () => {
         const camera = mockCameras[0]
         const mockResponse = wrapResponse(camera)
         vi.mocked(request.get).mockResolvedValue(mockResponse)
 
         const result = await getCamera(camera.cameraId)
 
-        expect(request.get).toHaveBeenCalledWith(`/camera/${camera.cameraId}`)
+        expect(request.get).toHaveBeenCalledWith(`/camera/control/${camera.cameraId}`)
         expect(result.data.cameraId).toBe(camera.cameraId)
       })
     })
@@ -90,26 +90,26 @@ describe('Camera API', () => {
     })
 
     describe('ptzStart', () => {
-      it('should call POST /camera/:id/ptz/start', async () => {
+      it('should call POST /camera/control/:id/ptz/start', async () => {
         const mockResponse = wrapResponse(null)
         vi.mocked(request.post).mockResolvedValue(mockResponse)
 
         await ptzStart('cam-001', 'up', 50)
 
-        expect(request.post).toHaveBeenCalledWith('/camera/cam-001/ptz/start', undefined, {
+        expect(request.post).toHaveBeenCalledWith('/camera/control/cam-001/ptz/start', undefined, {
           params: { action: 'up', speed: 50 }
         })
       })
     })
 
     describe('ptzStop', () => {
-      it('should call POST /camera/:id/ptz/stop', async () => {
+      it('should call POST /camera/control/:id/ptz/stop', async () => {
         const mockResponse = wrapResponse(null)
         vi.mocked(request.post).mockResolvedValue(mockResponse)
 
         await ptzStop('cam-001')
 
-        expect(request.post).toHaveBeenCalledWith('/camera/cam-001/ptz/stop')
+        expect(request.post).toHaveBeenCalledWith('/camera/control/cam-001/ptz/stop')
       })
     })
   })