#!perl
use Cassandane::Tiny;

sub test_calendarevent_set_bogus_replyto
    :min_version_3_7 :needs_component_jmap
{
    my ($self) = @_;
    my $jmap = $self->{jmap};

    my $res = $jmap->CallMethods([
        ['CalendarEvent/set', {
            create => {
                event1 => {
                    calendarIds => {
                        'Default' => JSON::true,
                    },
                    title => "event1",
                    start => "2021-01-01T02:00:00",
                    timeZone => 'Europe/Berlin',
                    duration => 'PT1H',
                    replyTo => 'cassandane@example.com',
                    participants => {
                        part1 => {
                            sendTo => {
                                imip => 'part1@example.com',
                            },
                        },
                    },
                },
                event2 => {
                    calendarIds => {
                        'Default' => JSON::true,
                    },
                    title => "event2",
                    start => "2021-01-01T02:00:00",
                    timeZone => 'Europe/Berlin',
                    duration => 'PT1H',
                    replyTo => {
                        imip => 'cassandane@example.com',
                    },
                    participants => {
                        part1 => {
                            sendTo => 'part1@example.com',
                        },
                    },
                },
            },
        }, 'R1'],
    ]);
    $self->assert_deep_equals(['replyTo'],
        $res->[0][1]{notCreated}{event1}{properties});
    $self->assert_deep_equals(['participants/part1/sendTo'],
        $res->[0][1]{notCreated}{event2}{properties});
}
