Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
santosh1994 committed Sep 16, 2024
1 parent 5b07b05 commit e802b31
Show file tree
Hide file tree
Showing 3 changed files with 4,680 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ const replaceUserGroupName = (usergroups) => (match) => {
match.subteamName ||
(match.subteamID && usergroups && usergroups[match.subteamID])
if (userGroupName) {
return `@${userGroupName}`;
return `@${userGroupName}`
}
return escapeTags(match.toString())
}
Expand Down
8 changes: 6 additions & 2 deletions test/controlSequenceTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,15 @@ describe('control sequences', () => {

describe('for the subteam command', () => {
it('should render as a group link when the label is present', () => {
escapeForSlack('<!subteam^S123|swiftype-eng>').should.equal('swiftype-eng')
escapeForSlack("<!subteam^S123|swiftype-eng>").should.equal(
"@swiftype-eng"
);
})

it('should render the group name if present', () => {
escapeForSlack('<!subteam^S123>', { usergroups: { S123: 'swiftype-eng' } }).should.equal('swiftype-eng')
escapeForSlack("<!subteam^S123>", {
usergroups: { S123: "swiftype-eng" },
}).should.equal("@swiftype-eng");
})

it('should render the original value if the channel name is not present', () => {
Expand Down
Loading

0 comments on commit e802b31

Please sign in to comment.