import {mount} from '@vue/test-utils';

import {describe, expect, it} from 'vitest';

import ChatShimmerText from '../ChatShimmerText.vue';

describe('ChatShimmerText', () => {
  it('renders text and toggles active shimmer class', async () => {
    const wrapper = mount(ChatShimmerText, {
      props: {
        active: true,
        text: '正在检索知识库',
      },
    });

    expect(wrapper.text()).toBe('正在检索知识库');
    expect(wrapper.classes()).toContain('is-active');

    await wrapper.setProps({ active: false });

    expect(wrapper.classes()).not.toContain('is-active');
  });
});
