#!perl
use Cassandane::Tiny;

sub test_email_query_window_guidsearch
    :min_version_3_1 :needs_component_sieve
    :JMAPExtensions
{
    my ($self) = @_;

    # guidsearch supports calculating total if version >= 3.5
    my ($maj, $min) = Cassandane::Instance->get_version();
    my $calculateTotal = ($maj > 3 || ($maj == 3 && $min >= 5)) ? JSON::true : JSON::false;

    $self->email_query_window_internal(
        wantGuidSearch => JSON::true,
        calculateTotal => $calculateTotal,
        filter => { subject => 'Email'},
    );
}
