#!perl
use Cassandane::Tiny;

sub test_calendar_set_unknown_calendarright
    :min_version_3_5 :needs_component_jmap
{
    my ($self) = @_;

    my $jmap = $self->{jmap};

    $self->create_user('sharee');

    my $res = $jmap->CallMethods([
        ['Calendar/set', {
            update => {
                Default => {
                    shareWith => {
                        sharee => {
                            unknownCalendarRight => JSON::true,
                        },
                    },
                },
            },
        }, 'R1'],
    ]);

    $self->assert_str_equals('invalidProperties',
        $res->[0][1]{notUpdated}{Default}{type});

    $self->assert_deep_equals(['shareWith/sharee/unknownCalendarRight'],
        $res->[0][1]{notUpdated}{Default}{properties});
}
