import{u as o,i as r}from"./testApp-D0cQFb_-.js";import{i as a}from"./jasmine-utils-CryYQKuX.js";function n(t,s){const e=t.contactList.map(({mail:d})=>d);return r(e,s)}describe("contacts store",()=>{let t,s,e;beforeAll(async()=>{({fstUserAddr:s,sndUserAddr:e}=window.testSetup),t=o()}),a("lists and adds addresses",async()=>{expect(n(t,s)).withContext("own address is present by default").toBeTrue(),n(t,e)||(await t.addContact(e),expect(n(t,e)).withContext("address is present after addition").toBeTrue()),await t.addContact(e).then(()=>fail("adding account second time should fail"),d=>{expect(d.contactAlreadyExists).toBeTrue()})}),a("adding non-existing address should fail",async()=>{await t.addContact("non-existing user @example.com").then(()=>fail("adding non-existing address should've failed"),i=>{expect(i.failASMailCheck).toBeTrue()})})});
