using NATS.Server.JetStream.Cluster;

namespace NATS.Server.JetStream.Tests.JetStream;

public class JetStreamReplicaGovernanceStrictParityTests
{
    [Fact]
    public async Task Meta_and_replica_governance_actions_reflect_committed_state_transitions()
    {
        var group = new StreamReplicaGroup("ORDERS_GOV", replicas: 3);
        var beforeLeader = group.Leader.Id;

        await group.StepDownAsync(default);
        group.Leader.Id.ShouldNotBe(beforeLeader);

        var index = await group.ProposeAsync("set placement", default);
        index.ShouldBeGreaterThan(0);
    }
}
