Explorar el Código

fix: updated tests with pointers

Fela Maslen hace 4 años
padre
commit
a52f14309c
Se han modificado 1 ficheros con 14 adiciones y 6 borrados
  1. 14 6
      gmus-backend/pkg/server/actions_test.go

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

@@ -41,14 +41,18 @@ var _ = Describe("Server actions", func() {
 				action.FromClient = &myClient
 
 				songId := 123
+				playing := true
+				currentTime := float32(94)
+				seekTime := float32(-1)
+
 				expectedAction := server.Action{
 					Type:       server.StateSet,
 					FromClient: &myClient,
 					Payload: server.MusicPlayer{
 						SongId:        &songId,
-						Playing:       true,
-						CurrentTime:   94,
-						SeekTime:      -1,
+						Playing:       &playing,
+						CurrentTime:   &currentTime,
+						SeekTime:      &seekTime,
 						Master:        "some-master-client",
 						ActiveClients: &[]string{},
 						Queue:         &[]int{},
@@ -85,13 +89,17 @@ var _ = Describe("Server actions", func() {
 				var action server.Action
 				json.Unmarshal([]byte(actionStateSetSongIdNull), &action)
 
+				playing := false
+				currentTime := float32(0)
+				seekTime := float32(-1)
+
 				expectedAction := server.Action{
 					Type: server.StateSet,
 					Payload: server.MusicPlayer{
 						SongId:        nil,
-						Playing:       false,
-						CurrentTime:   0,
-						SeekTime:      -1,
+						Playing:       &playing,
+						CurrentTime:   &currentTime,
+						SeekTime:      &seekTime,
 						Master:        "some-master-client",
 						ActiveClients: &[]string{},
 						Queue:         &[]int{},