From 9d20fce9ad1db0077948725baaafcc45c8d51cc3 Mon Sep 17 00:00:00 2001 From: Sasial <44125644+sasial-dev@users.noreply.github.com> Date: Sat, 5 Aug 2023 08:27:02 +1000 Subject: [PATCH] Fix failing e2e tests --- ...d__tests__build__script_meta_disabled.snap | 1 + ...o_end__tests__build__server_in_folder.snap | 1 + ...end_to_end__tests__build__server_init.snap | 1 + ...d_to_end__tests__serve__scripts_all-2.snap | 2 ++ ...end_to_end__tests__serve__scripts_all.snap | 2 ++ tests/tests/serve.rs | 22 +++++++++++-------- 6 files changed, 20 insertions(+), 9 deletions(-) diff --git a/rojo-test/build-test-snapshots/end_to_end__tests__build__script_meta_disabled.snap b/rojo-test/build-test-snapshots/end_to_end__tests__build__script_meta_disabled.snap index 0876056e2..28354bd64 100644 --- a/rojo-test/build-test-snapshots/end_to_end__tests__build__script_meta_disabled.snap +++ b/rojo-test/build-test-snapshots/end_to_end__tests__build__script_meta_disabled.snap @@ -11,6 +11,7 @@ expression: contents hello true + 0 -- This script should be marked 'Disabled' diff --git a/rojo-test/build-test-snapshots/end_to_end__tests__build__server_in_folder.snap b/rojo-test/build-test-snapshots/end_to_end__tests__build__server_in_folder.snap index 282889d0f..c9806d005 100644 --- a/rojo-test/build-test-snapshots/end_to_end__tests__build__server_in_folder.snap +++ b/rojo-test/build-test-snapshots/end_to_end__tests__build__server_in_folder.snap @@ -10,6 +10,7 @@ expression: contents serverScript + 0 -- This is a Lua server script diff --git a/rojo-test/build-test-snapshots/end_to_end__tests__build__server_init.snap b/rojo-test/build-test-snapshots/end_to_end__tests__build__server_init.snap index 070b7012a..5858d5e01 100644 --- a/rojo-test/build-test-snapshots/end_to_end__tests__build__server_init.snap +++ b/rojo-test/build-test-snapshots/end_to_end__tests__build__server_init.snap @@ -6,6 +6,7 @@ expression: contents server_init + 0 return "From folder/init.server.lua" diff --git a/rojo-test/serve-test-snapshots/end_to_end__tests__serve__scripts_all-2.snap b/rojo-test/serve-test-snapshots/end_to_end__tests__serve__scripts_all-2.snap index 78dcebea3..49d8148b3 100644 --- a/rojo-test/serve-test-snapshots/end_to_end__tests__serve__scripts_all-2.snap +++ b/rojo-test/serve-test-snapshots/end_to_end__tests__serve__scripts_all-2.snap @@ -24,6 +24,8 @@ instances: Name: bar Parent: id-2 Properties: + RunContext: + Enum: 0 Source: String: "-- Hello, from bar!" id-4: diff --git a/rojo-test/serve-test-snapshots/end_to_end__tests__serve__scripts_all.snap b/rojo-test/serve-test-snapshots/end_to_end__tests__serve__scripts_all.snap index 52efebac4..62e5ceeff 100644 --- a/rojo-test/serve-test-snapshots/end_to_end__tests__serve__scripts_all.snap +++ b/rojo-test/serve-test-snapshots/end_to_end__tests__serve__scripts_all.snap @@ -24,6 +24,8 @@ instances: Name: bar Parent: id-2 Properties: + RunContext: + Enum: 0 Source: String: "-- Hello, from bar!" id-4: diff --git a/tests/tests/serve.rs b/tests/tests/serve.rs index 9cca9fac1..d55d339bb 100644 --- a/tests/tests/serve.rs +++ b/tests/tests/serve.rs @@ -1,6 +1,6 @@ use std::fs; -use insta::assert_yaml_snapshot; +use insta::{assert_yaml_snapshot, with_settings}; use tempfile::tempdir; use crate::rojo_test::{internable::InternAndRedact, serve_util::run_serve_test}; @@ -30,10 +30,12 @@ fn scripts() { assert_yaml_snapshot!("scripts_info", redactions.redacted_yaml(info)); let read_response = session.get_api_read(root_id).unwrap(); - assert_yaml_snapshot!( - "scripts_all", - read_response.intern_and_redact(&mut redactions, root_id) - ); + with_settings!({ sort_maps => true }, { + assert_yaml_snapshot!( + "scripts_all", + read_response.intern_and_redact(&mut redactions, root_id) + ); + }); fs::write(session.path().join("src/foo.lua"), "Updated foo!").unwrap(); @@ -44,10 +46,12 @@ fn scripts() { ); let read_response = session.get_api_read(root_id).unwrap(); - assert_yaml_snapshot!( - "scripts_all-2", - read_response.intern_and_redact(&mut redactions, root_id) - ); + with_settings!({ sort_maps => true }, { + assert_yaml_snapshot!( + "scripts_all-2", + read_response.intern_and_redact(&mut redactions, root_id) + ); + }); }); }