UNPKG

@sprucelabs/spruce-cli

Version:

Command line interface for building Spruce skills.

47 lines 1.69 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const test_utils_1 = require("@sprucelabs/test-utils"); const uiAssert = { async assertRendersSelect(ui) { await ui.waitForInput(); const last = ui.getLastInvocation(); test_utils_1.assert.isTruthy(last.options.options.choices, `I expected a select, I did not find one!`); return last.options; }, assertSelectDidNotRenderChoice(ui, value, label) { const last = ui.getLastInvocation(); test_utils_1.assert.doesNotInclude(last.options.options.choices, { value, label, }); }, assertSelectRenderChoice(ui, value, label) { const last = ui.getLastInvocation(); test_utils_1.assert.doesInclude(last.options.options.choices, { value, label, }); }, assertRendersDirectorySelect(ui, defaultValue) { const last = ui.getLastInvocation(); test_utils_1.assert.doesInclude(last.options, { type: 'directory', defaultValue: { path: defaultValue }, }); }, async assertRendersConfirmWriteFile(ui) { await ui.waitForInput(); const last = ui.getLastInvocation(); test_utils_1.assert.isEqual(last.options.type, 'select'); test_utils_1.assert.isEqualDeep(last.options.options.choices, [ { label: 'Overwrite', value: 'overwrite', }, { value: 'skip', label: 'Skip' }, { value: 'alwaysSkip', label: 'Always skip' }, ]); }, }; exports.default = uiAssert; //# sourceMappingURL=uiAssert.utility.js.map