Skip to content

Commit

Permalink
test(api): fix test for empty categories
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
josecelano committed Jun 19, 2023
1 parent 34db879 commit b4744e7
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/e2e/contexts/category/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,13 @@ async fn it_should_allow_adding_empty_categories() {
let mut env = TestEnv::new();
env.start(api::Implementation::ActixWeb).await;

if env.is_shared() {
// This test cannot be run in a shared test env because it will fail
// when the empty category already exits
println!("Skipped");
return;
}

let logged_in_admin = new_logged_in_admin(&env).await;
let client = Client::authenticated(&env.server_socket_addr().unwrap(), &logged_in_admin.token);

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

if env.is_shared() {
// This test cannot be run in a shared test env because it will fail
// when the empty category already exits
println!("Skipped");
return;
}

if env::var(ENV_VAR_E2E_EXCLUDE_AXUM_IMPL).is_ok() {
println!("Skipped");
return;
Expand Down

0 comments on commit b4744e7

Please sign in to comment.