mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-03 12:37:56 +00:00
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:
@@ -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', () => {
|
||||
|
||||
Reference in New Issue
Block a user