#!perl
use Cassandane::Tiny;

sub test_calendarevent_guesstz_gmt
    :min_version_3_5 :needs_component_jmap :needs_dependency_guesstz
{
    my ($self) = @_;
    my $jmap = $self->{jmap};
    my $caldav = $self->{caldav};

    my $eventId = '123456789';
    my $ical = <<EOF;
BEGIN:VCALENDAR
PRODID: -//xxx//yyy//EN
VERSION:2.0
BEGIN:VTIMEZONE
TZID:Custom
LAST-MODIFIED:20210127T134508Z
X-LIC-LOCATION:Etc/GMT+8
X-PROLEPTIC-TZNAME:-08
BEGIN:STANDARD
TZNAME:-08
TZOFFSETFROM:-0800
TZOFFSETTO:-0800
DTSTART:16010101T000000
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
UID:$eventId
DTSTAMP:20201226T180609
DTSTART;TZID=Custom:20201227T140000
DURATION:PT1H
SUMMARY:A summary
CLASS:PUBLIC
END:VEVENT
END:VCALENDAR
EOF

    my $event = $self->putandget_vevent($eventId,
        $ical, ['timeZone');
    $self->assert_str_equals('Etc/GMT+8', $event->{timeZone});
}
