Skip to content

Commit 2cc3fd6

Browse files
⚗️ Update tests.
1 parent 574316a commit 2cc3fd6

2 files changed

Lines changed: 242 additions & 286 deletions

File tree

test/integration/runtime_test.gleam

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,10 @@ pub fn client_send_event_test() {
6666
runtime.ClientDispatchedMessage(click) |> lustre.send(to: runtime)
6767

6868
let patch =
69-
patch.new(0, 0, [], [
70-
patch.new(0, 0, [], [
71-
patch.new(1, 0, [], [patch.new(0, 0, [patch.replace_text("1")], [])]),
72-
]),
73-
])
69+
patch.new(0, 0, [patch.replace_text("1")], [])
70+
|> patch.add_parent(1)
71+
|> patch.add_parent(0)
72+
|> patch.add_parent(0)
7473

7574
assert process.receive_forever(client)
7675
== transport.reconcile(patch, mutable_map.new())
@@ -93,11 +92,10 @@ pub fn client_send_multiple_events_test() {
9392
let _ = process.receive_forever(client)
9493

9594
let patch =
96-
patch.new(0, 0, [], [
97-
patch.new(0, 0, [], [
98-
patch.new(1, 0, [], [patch.new(0, 0, [patch.replace_text("2")], [])]),
99-
]),
100-
])
95+
patch.new(0, 0, [patch.replace_text("2")], [])
96+
|> patch.add_parent(1)
97+
|> patch.add_parent(0)
98+
|> patch.add_parent(0)
10199

102100
assert process.receive_forever(client)
103101
== transport.reconcile(patch, mutable_map.new())
@@ -117,11 +115,10 @@ pub fn effect_send_event_test() {
117115
|> lustre.send(to: runtime)
118116

119117
let patch =
120-
patch.new(0, 0, [], [
121-
patch.new(0, 0, [], [
122-
patch.new(1, 0, [], [patch.new(0, 0, [patch.replace_text("1")], [])]),
123-
]),
124-
])
118+
patch.new(0, 0, [patch.replace_text("1")], [])
119+
|> patch.add_parent(1)
120+
|> patch.add_parent(0)
121+
|> patch.add_parent(0)
125122

126123
assert process.receive_forever(client)
127124
== transport.reconcile(patch, mutable_map.new())

0 commit comments

Comments
 (0)