CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-slack--types

Comprehensive TypeScript type definitions for building Slack applications and integrations with the Node Slack SDK

94

1.11x
Overview
Eval results
Files

task.mdevals/scenario-8/

Team Survey Message Builder

Overview

Build a function that generates a Slack Block Kit message for conducting team surveys. The message should collect multiple responses from team members using various multi-select input types.

Requirements

Create a TypeScript function createTeamSurveyMessage that returns a valid Slack message structure with blocks for collecting survey responses.

The survey message should include:

  1. A header section introducing the survey
  2. An input block for selecting multiple team members who contributed to a project
  3. An input block for selecting multiple relevant Slack channels where the project was discussed
  4. An input block for selecting multiple skill areas from a predefined list of options (e.g., "Frontend Development", "Backend Development", "Design", "Testing", "Documentation")
  5. An input block for selecting multiple project phases that were completed (e.g., "Planning", "Development", "Testing", "Deployment", "Maintenance")

Each input block should:

  • Have a unique block_id
  • Have a descriptive label
  • Include an action_id for the input element
  • Support selecting multiple items

The skill areas and project phases should use static options with both a text label and a value.

Dependencies { .dependencies }

@slack/types { .dependency }

Provides TypeScript type definitions for Slack Block Kit components including blocks, elements, and composition objects.

Test Cases

Test 1: Basic Structure @test

Input: Call createTeamSurveyMessage()

Expected Output: Function returns an object containing:

  • A blocks array property
  • At least 5 blocks in the array
  • First block should be a header or section introducing the survey
  • Four input blocks for collecting multi-select responses

File: survey.test.ts

Test 2: Multi-Select Element Types @test

Input: Call createTeamSurveyMessage() and examine the input blocks

Expected Output: The message structure includes:

  • A multi-select element for users
  • A multi-select element for channels
  • Two multi-select elements with static options (for skills and project phases)
  • Each multi-select element has proper action_id and block_id properties

File: survey.test.ts

Test 3: Static Options Structure @test

Input: Call createTeamSurveyMessage() and examine the static multi-select options

Expected Output: Each static multi-select element contains:

  • An options array with at least 3 options
  • Each option has both a text object and a value property
  • The text objects have a type property set to either "plain_text" or "mrkdwn"

File: survey.test.ts

Install with Tessl CLI

npx tessl i tessl/npm-slack--types

tile.json