Skip to content

Commit

Permalink
Fix failing e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sasial-dev committed Aug 4, 2023
1 parent 6475a62 commit 9d20fce
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ expression: contents
<Properties>
<string name="Name">hello</string>
<bool name="Disabled">true</bool>
<token name="RunContext">0</token>
<string name="Source">-- This script should be marked 'Disabled'</string>
</Properties>
</Item>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ expression: contents
<Item class="Script" referent="1">
<Properties>
<string name="Name">serverScript</string>
<token name="RunContext">0</token>
<string name="Source">-- This is a Lua server script</string>
</Properties>
</Item>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ expression: contents
<Item class="Script" referent="0">
<Properties>
<string name="Name">server_init</string>
<token name="RunContext">0</token>
<string name="Source">return "From folder/init.server.lua"</string>
</Properties>
</Item>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ instances:
Name: bar
Parent: id-2
Properties:
RunContext:
Enum: 0
Source:
String: "-- Hello, from bar!"
id-4:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ instances:
Name: bar
Parent: id-2
Properties:
RunContext:
Enum: 0
Source:
String: "-- Hello, from bar!"
id-4:
Expand Down
22 changes: 13 additions & 9 deletions tests/tests/serve.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand Down Expand Up @@ -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();

Expand All @@ -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)
);
});
});
}

Expand Down

0 comments on commit 9d20fce

Please sign in to comment.