## Summary before & after  <img width="575" alt="image" src="https://github.com/n8n-io/n8n/assets/8850410/e7d5ecd5-427e-4664-897f-5a42e68e3661"> #### How to test the change: 1. Add Pipedrive > Create Deal 2. Click on "Add Field" under "Additional Fields" 3. Options should be properly displayed (Title case) ## Issues fixed https://linear.app/n8n/issue/NODE-977 ## Review / Merge checklist - [ ] PR title and summary are descriptive. **Remember, the title automatically goes into the changelog. Use `(no-changelog)` otherwise.** ([conventions](https://github.com/n8n-io/n8n/blob/master/.github/pull_request_title_conventions.md)) - [ ] [Docs updated](https://github.com/n8n-io/n8n-docs) or follow-up ticket created. - [ ] Tests included. > A bug is not considered fixed, unless a test is added to prevent it from happening again. A feature is not complete without tests. > > *(internal)* You can use Slack commands to trigger [e2e tests](https://www.notion.so/n8n/How-to-use-Test-Instances-d65f49dfc51f441ea44367fb6f67eb0a?pvs=4#a39f9e5ba64a48b58a71d81c837e8227) or [deploy test instance](https://www.notion.so/n8n/How-to-use-Test-Instances-d65f49dfc51f441ea44367fb6f67eb0a?pvs=4#f6a177d32bde4b57ae2da0b8e454bfce) or [deploy early access version on Cloud](https://www.notion.so/n8n/Cloudbot-3dbe779836004972b7057bc989526998?pvs=4#fef2d36ab02247e1a0f65a74f6fb534e).
50 lines
1.2 KiB
TypeScript
50 lines
1.2 KiB
TypeScript
import { createComponentRenderer } from '@/__tests__/render';
|
|
import { createTestingPinia } from '@pinia/testing';
|
|
import CollectionParameter from '../CollectionParameter.vue';
|
|
|
|
const renderComponent = createComponentRenderer(CollectionParameter, {
|
|
pinia: createTestingPinia(),
|
|
});
|
|
|
|
describe('CollectionParameter', () => {
|
|
afterEach(() => {
|
|
vi.clearAllMocks();
|
|
});
|
|
|
|
it('should render collection options correctly', async () => {
|
|
const { getAllByTestId } = renderComponent({
|
|
props: {
|
|
path: 'parameters.additionalFields',
|
|
parameter: {
|
|
displayName: 'Additional Fields',
|
|
name: 'additionalFields',
|
|
type: 'collection',
|
|
options: [
|
|
{
|
|
displayName: 'Currency',
|
|
name: 'currency',
|
|
type: 'string',
|
|
default: 'USD',
|
|
},
|
|
{
|
|
displayName: 'Value',
|
|
name: 'value',
|
|
type: 'number',
|
|
},
|
|
],
|
|
},
|
|
nodeValues: {
|
|
parameters: {
|
|
additionalFields: {},
|
|
},
|
|
},
|
|
},
|
|
});
|
|
|
|
const options = getAllByTestId('collection-parameter-option');
|
|
expect(options.length).toBe(2);
|
|
expect(options.at(0)).toHaveTextContent('Currency');
|
|
expect(options.at(1)).toHaveTextContent('Value');
|
|
});
|
|
});
|