<commit_before>import { shallowMount } from '@vue/test-utils'
import AvatarWrapper from './AvatarWrapper'

describe('AvatarWrapper.vue', () => {
	it('Renders user avatars properly', () => {
		const wrapper = shallowMount(AvatarWrapper, {
			propsData: {
				id: 'test-id',
				source: 'users',
				name: 'test-name',
			},
		})
		expect(wrapper.vm.iconClass).toBe('')
		// Check that the first child is the avatar component
		expect(wrapper.element.firstChild.nodeName).toBe('AVATAR-STUB')
		expect(wrapper.props().size).toBe(32)
	})
	it('Renders group icons properly', () => {
		const wrapper = shallowMount(AvatarWrapper, {
			propsData: {
				id: '',
				source: 'groups',
				name: '',
			},
		})
		expect(wrapper.vm.iconClass).toBe('icon-contacts')
		// Check that the first child is a div
		expect(wrapper.element.firstChild.nodeName).toBe('DIV')
	})
	it('Renders email icons properly', () => {
		const wrapper = shallowMount(AvatarWrapper, {
			propsData: {
				id: '',
				source: 'emails',
				name: '',
			},
		})
		expect(wrapper.vm.iconClass).toBe('icon-mail')
		// Check that the first child is a div
		expect(wrapper.element.firstChild.nodeName).toBe('DIV')
		// proper size
		expect(wrapper.element.firstChild.classList).toContain('avatar-32px')
	})
	it('Renders guests icons properly', () => {
		const wrapper = shallowMount(AvatarWrapper, {
			propsData: {
				id: '',<commit_msg>Fix unit test<commit_after>import { shallowMount } from '@vue/test-utils'
import AvatarWrapper from './AvatarWrapper'

describe('AvatarWrapper.vue', () => {
	it('Renders user avatars properly', () => {
		const wrapper = shallowMount(AvatarWrapper, {
			propsData: {
				id: 'test-id',
				source: 'users',
				name: 'test-name',
			},
		})
		expect(wrapper.vm.iconClass).toBe('')
		// Check that the first child is the avatar component
		expect(wrapper.element.firstChild.nodeName).toBe('AVATAR-STUB')
		expect(wrapper.props().size).toBe(32)
	})
	it('Renders group icons properly', () => {
		const wrapper = shallowMount(AvatarWrapper, {
			propsData: {
				id: '',
				source: 'groups',
				name: '',
			},
		})
		expect(wrapper.vm.iconClass).toBe('icon-contacts')
		// Check that the first child is a div
		expect(wrapper.element.firstChild.nodeName).toBe('DIV')
	})
	it('Renders email icons properly', () => {
		const wrapper = shallowMount(AvatarWrapper, {
			propsData: {
				id: '',
				source: 'emails',
				name: '',
			},
		})
		expect(wrapper.vm.iconClass).toBe('icon-mail')
		// Check that the first child is a div
		expect(wrapper.element.firstChild.nodeName).toBe('DIV')
		// proper size
		expect(wrapper.element.firstChild.classList).toContain('avatar-32px')
	})
	it('Renders guests icons properly', () => {
		const wrapper = shallowMount(AvatarWrapper, {
			propsData: {
				id: 'random-sha1',
				source: 'guests',
{'fraction_non_alphanumeric': 0.16590024761230987, 'fraction_numerical': 0.0031835868411743897, 'mean_word_length': 3.777027027027027, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2396860', 'n_tokens_mistral': 1065, 'n_tokens_neox': 919, 'n_words': 187}