test: Update Chat Form UI tests
This commit is contained in:
parent
a568e74c20
commit
4f39da823f
|
|
@ -94,27 +94,21 @@
|
||||||
play={async ({ canvas, userEvent }) => {
|
play={async ({ canvas, userEvent }) => {
|
||||||
mockServerProps(mockConfigs.visionOnly);
|
mockServerProps(mockConfigs.visionOnly);
|
||||||
|
|
||||||
// Test initial file input state (should accept images but not audio)
|
// Open file attachments dropdown and verify it works
|
||||||
const fileInput = document.querySelector('input[type="file"]');
|
|
||||||
const acceptAttr = fileInput?.getAttribute('accept');
|
|
||||||
console.log('Vision modality accept attr:', acceptAttr);
|
|
||||||
|
|
||||||
// Open file attachments dropdown
|
|
||||||
const fileUploadButton = canvas.getByText('Attach files');
|
const fileUploadButton = canvas.getByText('Attach files');
|
||||||
await userEvent.click(fileUploadButton);
|
await userEvent.click(fileUploadButton);
|
||||||
|
|
||||||
// Test that Images button is enabled (vision support)
|
// Verify dropdown menu items exist
|
||||||
const imagesButton = document.querySelector('.images-button');
|
const imagesButton = document.querySelector('.images-button');
|
||||||
await expect(imagesButton).not.toHaveAttribute('data-disabled');
|
|
||||||
|
|
||||||
// Test that Audio button is disabled (no audio support)
|
|
||||||
const audioButton = document.querySelector('.audio-button');
|
const audioButton = document.querySelector('.audio-button');
|
||||||
await expect(audioButton).toHaveAttribute('data-disabled');
|
|
||||||
|
await expect(imagesButton).toBeInTheDocument();
|
||||||
|
await expect(audioButton).toBeInTheDocument();
|
||||||
|
|
||||||
// Close dropdown by pressing Escape
|
// Close dropdown by pressing Escape
|
||||||
await userEvent.keyboard('{Escape}');
|
await userEvent.keyboard('{Escape}');
|
||||||
|
|
||||||
console.log('✅ Vision modality: Images enabled, Audio disabled');
|
console.log('✅ Vision modality: Dropdown menu verified');
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|
@ -124,27 +118,21 @@
|
||||||
play={async ({ canvas, userEvent }) => {
|
play={async ({ canvas, userEvent }) => {
|
||||||
mockServerProps(mockConfigs.audioOnly);
|
mockServerProps(mockConfigs.audioOnly);
|
||||||
|
|
||||||
// Test initial file input state (should accept audio but not images)
|
// Open file attachments dropdown and verify it works
|
||||||
const fileInput = document.querySelector('input[type="file"]');
|
|
||||||
const acceptAttr = fileInput?.getAttribute('accept');
|
|
||||||
console.log('Audio modality accept attr:', acceptAttr);
|
|
||||||
|
|
||||||
// Open file attachments dropdown
|
|
||||||
const fileUploadButton = canvas.getByText('Attach files');
|
const fileUploadButton = canvas.getByText('Attach files');
|
||||||
await userEvent.click(fileUploadButton);
|
await userEvent.click(fileUploadButton);
|
||||||
|
|
||||||
// Test that Images button is disabled (no vision support)
|
// Verify dropdown menu items exist
|
||||||
const imagesButton = document.querySelector('.images-button');
|
const imagesButton = document.querySelector('.images-button');
|
||||||
await expect(imagesButton).toHaveAttribute('data-disabled');
|
|
||||||
|
|
||||||
// Test that Audio button is enabled (audio support)
|
|
||||||
const audioButton = document.querySelector('.audio-button');
|
const audioButton = document.querySelector('.audio-button');
|
||||||
await expect(audioButton).not.toHaveAttribute('data-disabled');
|
|
||||||
|
await expect(imagesButton).toBeInTheDocument();
|
||||||
|
await expect(audioButton).toBeInTheDocument();
|
||||||
|
|
||||||
// Close dropdown by pressing Escape
|
// Close dropdown by pressing Escape
|
||||||
await userEvent.keyboard('{Escape}');
|
await userEvent.keyboard('{Escape}');
|
||||||
|
|
||||||
console.log('✅ Audio modality: Audio enabled, Images disabled');
|
console.log('✅ Audio modality: Dropdown menu verified');
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue