Skip to content

Commit

Permalink
added contact task creation
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladimir Yazykov committed Jan 11, 2024
1 parent 9e498fc commit ef6b1d0
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion tests/api/entities/Contact.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ beforeEach(() => {
});

describe('Contact', () => {
test('adds embedded contact for lead', async () => {
test('adds embedded contact for contact', async () => {
const [contact] = await client.contacts.create([
{
name: 'Contact ' + (new Date).toJSON()
Expand All @@ -40,4 +40,25 @@ describe('Contact', () => {
});
expect(savedLead.embeddedContacts.length).toEqual(1);
});

test('adds task to contact', async () => {
const [contact] = await client.contacts.create([
{
name: 'Walter Scott',
},
]);

// создаём задачу для этого контакта
const [createdTask] = await contact.tasks.create([
{
text: 'contact task',
complete_till: 2280001362
}
]);

// получаем список задач, связанных с этим контактом
const [contactTask] = await contact.tasks.get();

expect(contactTask.id).toEqual(createdTask.id);
});
});

0 comments on commit ef6b1d0

Please sign in to comment.