#!perl
use Cassandane::Tiny;

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

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

    my $defaultId = 'Default';

    xlog "Attempt to destroy default addressbook";
    my $res = $jmap->CallMethods([
        ['AddressBook/set', {
            destroy => [$defaultId],
        }, 'R1'],
    ]);
    $self->assert_str_equals('forbidden',
        $res->[0][1]{notDestroyed}{$defaultId}{type});
}
