Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cc): getBuddyAgents implementation #3

Merged
merged 4 commits into from
Nov 12, 2024

Conversation

bhabalan
Copy link
Collaborator

@bhabalan bhabalan commented Nov 12, 2024

COMPLETES SPARK-567680

This pull request addresses

Fetching Buddy Agents

by making the following changes

introducing webex.cc.getBuddyAgents() API

Vidcast: https://app.vidcast.io/share/ae742d0a-126f-4e4c-90f0-0cf596473063

image [getBuddyAgents tests.zip](https://github.com/user-attachments/files/17717215/getBuddyAgents.tests.zip)

Change Type

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Tooling change
  • Internal code refactor

The following scenarios where tested

Manually tested in samples page for fetching buddy agents in following scenarios:

  1. Station login not done
  2. Station login done, buddy agents available
  3. Station login done, buddy agents not available

I certified that

  • I have read and followed contributing guidelines

  • I discussed changes with code owners prior to submitting this pull request

  • I have not skipped any automated checks

  • All existing and new tests passed

  • I have updated the documentation accordingly


Make sure to have followed the contributing guidelines before submitting.

@bhabalan bhabalan requested review from rsarika and adhmenon November 12, 2024 11:57
@bhabalan bhabalan self-assigned this Nov 12, 2024
@bhabalan bhabalan closed this Nov 12, 2024
@bhabalan bhabalan reopened this Nov 12, 2024
Copy link
Collaborator

@adhmenon adhmenon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM.

Copy link

@Kesari3008 Kesari3008 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving with few minor comments.
Please test scenario where if agentProfileId is missing, if the scenario is handled properly. If possible share the network logs for success and agentprofileID missing case in the PR

/**
* Returns the list of buddy agents in the given state and media according to agent profile settings
*
* @param {BuddyAgents} data - The data required to fetch buddy agents, including additional agent profile information.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the JSDOC, we should have either examples of how data looks like or talk about what data properties are here itself

@@ -17,6 +17,9 @@ export const CC_EVENTS = {
AGENT_STATE_CHANGE: 'AgentStateChange',
AGENT_STATE_CHANGE_SUCCESS: 'AgentStateChangeSuccess',
AGENT_STATE_CHANGE_FAILED: 'AgentStateChangeFailed',
AGENT_BUDDY_AGENTS: 'BuddyAgents',

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we have 2 constants for the same string?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just following the convention of One for the event name and one for success event. If the event name changes in the future, it'll just be a small change here in the constants

},
};

const buddyAgentsMock = jest

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a spy not mock so please update the name accordingly, also please use toHaveBeenCalledOnceWith instead of toHaveBeenCalledWith in all the places

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussed 1:1

@bhabalan bhabalan merged commit e61eac1 into rsarika:Agent-Req-From-Agentx Nov 12, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants