Skip to content

Open-source live-chat, email support, omni-channel desk. An alternative to Intercom, Zendesk, Salesforce Service Cloud etc. 🔥💬

856 B
Raw Blame
import { shallowMount } from '@vue/test-utils';
import AgentCapacityPolicyCard from './AgentCapacityPolicyCard.vue';
import CardPopover from '../components/CardPopover.vue';

describe('AgentCapacityPolicyCard', () => {
  it('shows avatars from the agent response in the assigned users popover', () => {
    const wrapper = shallowMount(AgentCapacityPolicyCard, {
      global: {
        stubs: {
          CardLayout: { template: '<div><slot /></div>' },
        },
      },
      props: {
        id: 1,
        users: [
          {
            id: 2,
            name: 'Agent',
            email: '[email protected]',
            thumbnail: 'https://example.com/avatar.png',
          },
        ],
      },
    });

    expect(wrapper.findComponent(CardPopover).props('items')[0].avatarUrl).toBe(
      'https://example.com/avatar.png'
    );
  });
});