Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/commands/integration/slack-channels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export function pickerOptions(
}

export function pickerMessage(selected: SlackChannelRef[]): string {
if (selected.length === 0) return 'Which public channels should Polylane join?';
if (selected.length === 0) return 'Where do you triage and discuss incidents?';
return `Selected: ${selected.map((c) => `#${c.name}`).join(', ')}. Add another public channel, or Done.`;
}

Expand Down
9 changes: 8 additions & 1 deletion test/integration-connect-slack-channels.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,17 @@ describe('pickerMessage', () => {
SLACK_CHANNEL_PICKER_NOTE,
'Find and add public channels here. For private channels, invite @Polylane from the channel in Slack.'
);
assert.equal(pickerMessage([]), 'Which public channels should Polylane join?');
assert.equal(pickerMessage([]), 'Where do you triage and discuss incidents?');
assert.match(pickerMessage([{ id: 'C1', name: 'alerts' }, { id: 'C2', name: 'deploys' }]), /#alerts, #deploys/);
});

it('keeps repeated-selection wording after a choice', () => {
assert.equal(
pickerMessage([{ id: 'C1', name: 'alerts' }, { id: 'C2', name: 'deploys' }]),
'Selected: #alerts, #deploys. Add another public channel, or Done.'
);
});

it('keeps empty and no-match states scoped to public channels without repeating the note', () => {
assert.equal(NO_SLACK_CHANNELS_LINE, 'No public Slack channels are available here.');
assert.equal(noSlackChannelMatchesLine('infra'), 'No public Slack channel matching "infra" is available here.');
Expand Down
Loading