Skip to content

Commit

Permalink
Fixes failing tests: block_actions.user.name is optional, as it can s…
Browse files Browse the repository at this point in the history
…till be present, e.g. in Home tab actions. Fix related test, too.
  • Loading branch information
filmaj committed Aug 1, 2023
1 parent eb80804 commit 9c73ef9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/types/actions/block-action.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe('Interactivity payload types', () => {
type: 'block_actions',
user: {
id: 'W111',
name: 'seratch',
username: 'seratch',
team_id: 'T111',
},
api_app_id: 'A02',
Expand Down
7 changes: 5 additions & 2 deletions src/types/actions/block-action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,12 @@ export interface BlockAction<ElementAction extends BasicElementAction = BlockEle
} | null;
user: {
id: string;
name: string;
/**
* name will be present if the block_action originates from the Home tab
*/
name?: string;
username: string;
team_id?: string; // undocumented
team_id?: string;
};
channel?: {
id: string;
Expand Down

0 comments on commit 9c73ef9

Please sign in to comment.