iachat/spec/services
Petterson 6e46be36c8
fix: Add fix to only allow confirmed agents to used in Agent Assingments at Macros/Automations (#13225)
# Pull Request Template

## Description

Unconfirmed agents (pending email verification) were incorrectly
appearing in the "assign agent" dropdown for macros and automations.
This fix filters out unconfirmed agents from these dropdowns and adds
backend validation to prevent assignment of unconfirmed agents.

Fixes #13223

## Type of change

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

## How Has This Been Tested?

**Backend tests:**
```bash
docker compose run --rm rails bundle exec rspec spec/services/action_service_spec.rb
```
- Added tests for confirmed agent assignment (should succeed)
- Added tests for unconfirmed agent assignment (should be skipped)

**Frontend tests:**
```bash
docker compose run --rm rails pnpm test app/javascript/dashboard/composables/spec/useMacros.spec.js
```
- Updated mocks to use `getVerifiedAgents` getter

**Manual testing:**
1. Create an unconfirmed agent via platform
2. Navigate to Settings → Macros → New Macro → Add "Assign Agent" action
3. Verify unconfirmed agent does NOT appear in dropdown
4. Navigate to Settings → Automations → New Automation → Add "Assign
Agent" action
5. Verify unconfirmed agent does NOT appear in dropdown

## Checklist:

- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my code
- [ ] 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

---------

Co-authored-by: Sojan Jose <sojan@pepalo.com>
2026-03-11 02:01:53 -07:00
..
account feat: Add automatic favicon fetching for companies (#13013) 2026-03-05 18:51:28 -08:00
auto_assignment perf: add default configs for assignment V2 (#13577) 2026-02-23 15:08:11 +05:30
automation_rules fix: country_code should be checked against the contact (#13186) 2026-01-13 14:47:27 +05:30
contacts feat: harden filter service 2026-03-09 21:19:20 +05:30
conversations feat: harden filter service 2026-03-09 21:19:20 +05:30
crm/leadsquared test(leadsquared): make ApiError specs reload-safe (#13098) 2025-12-17 13:30:34 -08:00
email chore: Migrate mailers from the worker to jobs (#12331) 2025-10-21 16:36:37 -07:00
facebook feat(facebook): use HUMAN_AGENT tag for Messenger replies when human-agent config is enabled (#13690) 2026-03-02 15:32:59 +04:00
google feat: add Google Email fetch and OAuth token refresh service (#9603) 2024-06-11 14:22:03 +05:30
imap feat: Add configurable interval for IMAP sync (#9302) 2024-04-25 18:58:20 -07:00
instagram feat: Handle instagram test service (#11244) 2025-04-11 19:11:29 +05:30
internal feat: add job to remove stale contacts and contact_inboxes (#11186) 2025-03-28 12:18:39 +05:30
labels fix: Update associations when a label is updated (#3046) 2021-09-21 10:16:32 +05:30
line feat(inbox): Enable conversation continuity for social channels (#11079) 2026-02-25 13:56:51 +04:00
linear feat: Whatsapp embedded signup (#11612) 2025-07-14 21:37:06 -07:00
liquid feat: Add liquid processing for SMS campaigns (#10981) 2025-06-11 13:16:44 -04:00
llm_formatter feat: Differentiate bot and user in the summary (#12801) 2025-11-05 11:42:21 -08:00
macros feat: Add webhook event support for macros (#11235) 2025-04-02 20:26:55 -07:00
mailbox refactor: strategy pattern for mailbox conversation finding (#12766) 2025-11-10 20:47:18 +05:30
message_templates fix: optimize message query with account_id filter (#13759) 2026-03-10 16:46:20 -07:00
messages fix: Skip notifications for private notes (#13617) 2026-02-23 15:40:54 +04:00
mfa feat: MFA (#12290) 2025-09-18 20:19:24 +05:30
microsoft chore: Refactor RefreshOauthTokenService to improve readability (#8820) 2024-01-31 12:24:12 +04:00
notification chore: Disable email notifications for unconfirmed users (#10964) 2025-02-24 12:14:40 -08:00
sms fix: Error shouldn't halt the campaign for entire audience (#11980) 2025-08-11 12:03:48 +05:30
telegram feat(inbox): Enable conversation continuity for social channels (#11079) 2026-02-25 13:56:51 +04:00
tiktok feat(inbox): Enable conversation continuity for social channels (#11079) 2026-02-25 13:56:51 +04:00
twilio feat: Add support for sending CSAT surveys via templates (Whatsapp Twilio) (#13143) 2026-01-13 16:32:02 +04:00
twitter chore: Enable the new Rubocop rules (#7122) 2023-05-19 14:37:10 +05:30
whatsapp feat(csat): Add WhatsApp utility template analyzer with rewrite guidance (#13575) 2026-02-24 15:11:04 +04:00
widget feat: speed up circleci and github actions (#12849) 2025-11-19 15:32:48 +05:30
account_deletion_service_spec.rb fix(account-deletion): normalize deleted email suffix and handle collisions safely (#13472) 2026-02-07 17:29:27 -08:00
action_service_spec.rb fix: Add fix to only allow confirmed agents to used in Agent Assingments at Macros/Automations (#13225) 2026-03-11 02:01:53 -07:00
base_token_service_spec.rb feat: MFA (#12290) 2025-09-18 20:19:24 +05:30
csat_survey_service_spec.rb fix: Respect survey label rules for WhatsApp CSAT template (#13285) 2026-01-15 22:16:00 -08:00
csat_template_utility_analysis_service_spec.rb feat(csat): Add WhatsApp utility template analyzer with rewrite guidance (#13575) 2026-02-24 15:11:04 +04:00
search_service_spec.rb feat: Advanced Search Backend (#12917) 2026-01-07 15:30:49 +05:30