aboutsummaryrefslogtreecommitdiff
path: root/azalea-client/tests/simulation/receive_start_config_packet.rs
blob: a54abe5be7d9cb8e3811a52eb2210931c0a48659 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use azalea_client::{InConfigState, test_utils::prelude::*};
use azalea_protocol::packets::{ConnectionProtocol, game::ClientboundStartConfiguration};
use azalea_world::WorldName;

#[test]
fn test_receive_start_config_packet() {
    let _lock = init();

    let mut simulation = Simulation::new(ConnectionProtocol::Game);

    simulation.receive_packet(default_login_packet());
    simulation.tick();
    assert!(simulation.has_component::<WorldName>());
    simulation.tick();

    simulation.receive_packet(ClientboundStartConfiguration);

    simulation.tick();
    assert!(simulation.has_component::<InConfigState>());
}