Skip to content

Commit b4744e7

Browse files
committed
test(api): fix test for empty categories
The application allows adding empty categories. The test cannot be executed in a shared env because it would fail the second tie is executed becuase the category already exists.
1 parent 34db879 commit b4744e7

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/e2e/contexts/category/contract.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,13 @@ async fn it_should_allow_adding_empty_categories() {
111111
let mut env = TestEnv::new();
112112
env.start(api::Implementation::ActixWeb).await;
113113

114+
if env.is_shared() {
115+
// This test cannot be run in a shared test env because it will fail
116+
// when the empty category already exits
117+
println!("Skipped");
118+
return;
119+
}
120+
114121
let logged_in_admin = new_logged_in_admin(&env).await;
115122
let client = Client::authenticated(&env.server_socket_addr().unwrap(), &logged_in_admin.token);
116123

@@ -342,6 +349,13 @@ mod with_axum_implementation {
342349
let mut env = TestEnv::new();
343350
env.start(api::Implementation::Axum).await;
344351

352+
if env.is_shared() {
353+
// This test cannot be run in a shared test env because it will fail
354+
// when the empty category already exits
355+
println!("Skipped");
356+
return;
357+
}
358+
345359
if env::var(ENV_VAR_E2E_EXCLUDE_AXUM_IMPL).is_ok() {
346360
println!("Skipped");
347361
return;

0 commit comments

Comments
 (0)