Skip to content
This repository has been archived by the owner on Sep 2, 2022. It is now read-only.

Commit

Permalink
add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
do4gr committed Aug 8, 2019
1 parent 71eaea8 commit f02e087
Showing 1 changed file with 42 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,48 @@ class SubscriptionFilterSpec extends FlatSpec with Matchers with SubscriptionSpe
}
}

"this" should "work when using aliases" in {
testInitializedWebsocket(project) { wsClient =>
wsClient.sendMessage(
startMessage(
id = "3",
query = """subscription {
| alias: todo{
| mutation
| previousValues {
| id
| text
| status
| }
| }
|}""".stripMargin
)
)

sleep(8000)

val event = nodeEvent(
modelId = model.name,
changedFields = Seq("text"),
previousValues = s"""{"id":"$testNodeId", "text":"event1", "status": "Active", "tags":[]}"""
)

sssEventsTestKit.publish(Only(s"subscription:event:${project.id}:updateTodo"), event)

wsClient.expectMessage(
dataMessage(
id = "3",
payload = s"""{
| "alias":{
| "mutation":"UPDATED",
| "previousValues":{"id":"$testNodeId", "text":"event1", "status":"Active"}
| }
|}""".stripMargin
)
)
}
}

"this" should "support scalar lists in previous values" ignore {
testInitializedWebsocket(project) { wsClient =>
wsClient.sendMessage(
Expand Down

0 comments on commit f02e087

Please sign in to comment.