fix: Translate "None" option in automation select (#11076)

# Pull Request Template

## Description

This PR includes a translation update for the "None" option in the
automation select for both agents and teams

## Type of change

- [x] Bug fix (non-breaking change which fixes an issue)



## Checklist:

- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my code
- [x] I have commented on my code, particularly in hard-to-understand
areas
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published in downstream
modules
This commit is contained in:
Sivin Varghese
2025-03-14 05:14:46 +05:30
committed by GitHub
parent 557df5c5c9
commit a8001ccabc
4 changed files with 60 additions and 13 deletions

View File

@@ -118,6 +118,46 @@ describe('getActionOptions', () => {
expectedOptions
);
});
it('adds None option when addNoneToListFn is provided', () => {
const mockAddNoneToListFn = list => [
{ id: 'nil', name: 'None' },
...(list || []),
];
const agents = [
{ id: 1, name: 'Agent 1' },
{ id: 2, name: 'Agent 2' },
];
const expectedOptions = [
{ id: 'nil', name: 'None' },
{ id: 1, name: 'Agent 1' },
{ id: 2, name: 'Agent 2' },
];
expect(
helpers.getActionOptions({
agents,
type: 'assign_agent',
addNoneToListFn: mockAddNoneToListFn,
})
).toEqual(expectedOptions);
});
it('does not add None option when addNoneToListFn is not provided', () => {
const agents = [
{ id: 1, name: 'Agent 1' },
{ id: 2, name: 'Agent 2' },
];
expect(
helpers.getActionOptions({
agents,
type: 'assign_agent',
})
).toEqual(agents);
});
});
describe('getConditionOptions', () => {