Skip to content

Commit 0c6ca31

Browse files
committed
Change command to textarea and add playwright test
1 parent d109844 commit 0c6ca31

File tree

3 files changed

+34
-5
lines changed

3 files changed

+34
-5
lines changed

openc3-cosmos-init/plugins/packages/openc3-vue-common/src/components/CommandEditor.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ export default {
313313
getCmdString() {
314314
let cmd = `${this.targetName} ${this.commandName}`
315315
if (this.computedRows.length === 0) return cmd
316-
cmd += ' with '
316+
cmd += ' with'
317317
for (const row of this.computedRows) {
318318
// null value indicates required parameter not set, see updateCmdParams
319319
if (row.val === null) {

openc3-cosmos-init/plugins/packages/openc3-vue-common/src/tools/calendar/ActivityCreateDialog.vue

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,11 +235,12 @@
235235
>
236236
</v-select>
237237
<div v-if="kind === 'COMMAND'">
238-
<v-text-field
238+
<v-textarea
239239
v-model="activityData"
240-
readonly
241-
type="text"
242240
label="Command Input"
241+
rows="1"
242+
readonly
243+
auto-grow
243244
data-test="activity-cmd"
244245
@click:control="editItem()"
245246
/>

playwright/tests/script-runner/edit-menu.p.spec.ts

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,32 @@ openc3 is everything I thought it could be`
5656
await expect(page.locator('text=0 of 0')).toBeVisible()
5757
})
5858

59-
test('inserts and edits commands', async ({ page, utils }) => {})
59+
test('inserts and edits commands', async ({ page, utils }) => {
60+
// await page.locator('textarea').click({ button: 'right' })
61+
await page.locator('.ace_content').click({
62+
button: 'right',
63+
})
64+
await page.getByText('Insert Command').click()
65+
await utils.selectTargetPacketItem('INST', 'ABORT')
66+
await page.getByRole('button', { name: 'Insert Command' }).click()
67+
68+
await page.locator('.ace_content').click({
69+
button: 'right',
70+
})
71+
await page.getByText('Insert Command').click()
72+
await utils.selectTargetPacketItem('INST', 'COLLECT')
73+
await page
74+
.locator('[data-test="cmd-param-select"]')
75+
.getByRole('combobox')
76+
.first()
77+
.click()
78+
await page.getByRole('option', { name: 'NORMAL' }).click()
79+
await page.getByRole('button', { name: 'Insert Command' }).click()
80+
81+
await expect(page.locator('.ace_content')).toContainText(
82+
'cmd("INST ABORT")\n',
83+
)
84+
await expect(page.locator('.ace_content')).toContainText(
85+
'cmd("INST COLLECT with TYPE \'NORMAL\', DURATION 1, OPCODE 0xAB, TEMP 0")\n',
86+
)
87+
})

0 commit comments

Comments
 (0)