Animate the Challenge after a live Match ends (#89)
This commit is contained in:
1 parent
aac2f4212c
commit
126912fd09
13 files changed
+687
-86
No files matched your search
@@ -669,6 +669,56 @@ fn play_arena_game(world: &World, tracker: &Tracker) {
|
||||
world.client.set_phase("EndOfGame", true);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn only_a_live_insert_reports_what_the_match_brought_to_the_challenge() {
|
||||
use arena_tracker_core::MatchEnd::*;
|
||||
let world = World::new(&s2_matches());
|
||||
let tracker = world.tracker();
|
||||
let follow = || {
|
||||
let mut events = Vec::new();
|
||||
tracker.follow_client_reporting(
|
||||
now(),
|
||||
None,
|
||||
&tracker.client_snapshot(),
|
||||
&mut |_| {},
|
||||
&mut |e| events.push(e),
|
||||
);
|
||||
events
|
||||
};
|
||||
assert!(follow().is_empty(), "history import");
|
||||
for (i, (placement, expected)) in [
|
||||
(6, Mark),
|
||||
(2, Mark),
|
||||
(3, Nothing),
|
||||
(1, Completion),
|
||||
(1, Nothing),
|
||||
]
|
||||
.into_iter()
|
||||
.enumerate()
|
||||
{
|
||||
let id = common::recorded_game_id() + i as u64;
|
||||
world.client.set_game_id(Some(id));
|
||||
world.client.set_phase("InProgress", true);
|
||||
assert!(follow().is_empty());
|
||||
world.history.add_unlisted(payload(
|
||||
&format!("EUW1_{id}"),
|
||||
1750,
|
||||
222,
|
||||
"Jinx",
|
||||
placement,
|
||||
placement <= 3,
|
||||
at(date(2026, 4, 5), i as i64),
|
||||
));
|
||||
world.client.set_phase("EndOfGame", true);
|
||||
let events = follow();
|
||||
assert_eq!(events.len(), 1);
|
||||
assert_eq!((events[0].champion_id, events[0].end), (222, expected));
|
||||
assert_eq!(events[0].puuid, SELF_PUUID);
|
||||
assert_eq!(events[0].season, S2);
|
||||
assert!(follow().is_empty());
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_finished_game_is_fetched_by_its_id_even_in_a_queue_nobody_lists() {
|
||||
let world = World::new(&s2_matches());
|
||||
|
||||
Reference in new issue
Block a user