#!perl
use Cassandane::Tiny;

sub test_addressbook_set_unknown_addressbookright
    :min_version_3_9 :needs_component_jmap :needs_dependency_icalvcard
{
    my ($self) = @_;

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

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

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

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