Forráskód Böngészése

chore: updated test fixtures

Fela Maslen 4 éve
szülő
commit
fa3c51f8cb

+ 14 - 12
gmus-backend/pkg/server/actions_test.go

@@ -45,12 +45,13 @@ var _ = Describe("Server actions", func() {
 					Type:       server.StateSet,
 					FromClient: &myClient,
 					Payload: server.MusicPlayer{
-						SongId:      &songId,
-						Playing:     true,
-						CurrentTime: 94,
-						SeekTime:    -1,
-						Master:      "some-master-client",
-						Queue:       &[]int{},
+						SongId:        &songId,
+						Playing:       true,
+						CurrentTime:   94,
+						SeekTime:      -1,
+						Master:        "some-master-client",
+						ActiveClients: &[]string{},
+						Queue:         &[]int{},
 					},
 				}
 				expectedActionString, jsonErr := json.Marshal(expectedAction)
@@ -87,12 +88,13 @@ var _ = Describe("Server actions", func() {
 				expectedAction := server.Action{
 					Type: server.StateSet,
 					Payload: server.MusicPlayer{
-						SongId:      nil,
-						Playing:     false,
-						CurrentTime: 0,
-						SeekTime:    -1,
-						Master:      "some-master-client",
-						Queue:       &[]int{},
+						SongId:        nil,
+						Playing:       false,
+						CurrentTime:   0,
+						SeekTime:      -1,
+						Master:        "some-master-client",
+						ActiveClients: &[]string{},
+						Queue:         &[]int{},
 					},
 				}
 

+ 12 - 6
gmus-backend/pkg/server/fixtures_test.go

@@ -9,7 +9,8 @@ const actionStateSetValid = `
     "currentTime": 94,
     "seekTime": -1,
     "queue": [],
-    "master": "some-master-client"
+    "master": "some-master-client",
+    "activeClients": []
   }
 }
 `
@@ -23,7 +24,8 @@ const actionStateSetIdNonPositive = `
     "currentTime": 94,
     "seekTime": -1,
     "queue": [],
-    "master": "some-master-client"
+    "master": "some-master-client",
+    "activeClients": []
   }
 }
 `
@@ -37,7 +39,8 @@ const actionStateSetSongIdNull = `
     "currentTime": 0,
     "seekTime": -1,
     "queue": [],
-    "master": "some-master-client"
+    "master": "some-master-client",
+    "activeClients": []
   }
 }
 `
@@ -51,7 +54,8 @@ const actionStateSetCurrentTimeNegative = `
     "currentTime": -32,
     "seekTime": -1,
     "queue": [],
-    "master": "some-master-client"
+    "master": "some-master-client",
+    "activeClients": []
   }
 }
 `
@@ -65,7 +69,8 @@ const actionStateSetSeekTimeTooNegative = `
     "currentTime": 13,
     "seekTime": -3,
     "queue": [],
-    "master": "some-master-client"
+    "master": "some-master-client",
+    "activeClients": []
   }
 }
 `
@@ -79,7 +84,8 @@ const actionStateSetMasterEmpty = `
     "currentTime": 13,
     "seekTime": -3,
     "queue": [],
-    "master": ""
+    "master": "",
+    "activeClients": []
   }
 }
 `