UNPKG

@sprucelabs/spruce-cli

Version:

Command line interface for building Spruce skills.

39 lines 2.21 kB
"use strict"; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const test_utils_1 = require("@sprucelabs/test-utils"); const AbstractEventTest_1 = __importDefault(require("../../../tests/AbstractEventTest")); class RegisteringConversationsOnBootTest extends AbstractEventTest_1.default { static async canRegisterConversationsOnBoot() { const { currentSkill } = await this.seedDummySkillRegisterCurrentSkillAndInstallToOrg('conversation'); await this.Action('conversation', 'create').execute({ nameReadable: 'book an appointment', nameCamel: 'bookAnAppointment', }); const boot = await this.Action('skill', 'boot').execute({ local: true }); const client = await this.connectToApi({ skillId: currentSkill.id, apiKey: currentSkill.apiKey, }); const topicResults = await this.Store('conversation', { apiClientFactory: async () => client, }).fetchRegisteredTopics(); const topics = topicResults.topics; boot.meta?.kill(); test_utils_1.assert.isLength(topics, 1); test_utils_1.assert.isEqual(topics[0].key, 'bookAnAppointment'); } } exports.default = RegisteringConversationsOnBootTest; __decorate([ test_utils_1.test.skip('bring back if re introducing conversation topics') ], RegisteringConversationsOnBootTest, "canRegisterConversationsOnBoot", null); //# sourceMappingURL=RegisteringConversationsOnBoot.test.js.map