diff --git a/apps/api/tests/flash_sales.rs b/apps/api/tests/flash_sales.rs index 9e9f993..e22220c 100644 --- a/apps/api/tests/flash_sales.rs +++ b/apps/api/tests/flash_sales.rs @@ -150,7 +150,8 @@ async fn inactive_window_falls_back_to_normal_price() { let res = add_item(&app, &owner, &session, &sku, 500, 5, 3).await; assert_eq!(res.status(), 201, "past sessions may still be configured"); - // Not discoverable as active. + // Not discoverable as active. Scoped to this session: the shared test + // database keeps sessions other tests created. let active: Vec = client() .get(app.url("/api/flash-sales")) .send() @@ -159,7 +160,10 @@ async fn inactive_window_falls_back_to_normal_price() { .json() .await .unwrap(); - assert!(active.is_empty(), "an elapsed session is not public"); + assert!( + active.iter().all(|s| s["id"] != session.as_str()), + "an elapsed session is not public" + ); let (token, _) = register_customer(&app, "fs-past").await; add_to_cart(&app, &token, &sku, 1).await;