Skip to content

Commit 4924fa0

Browse files
committed
Fix test
1 parent c0805a9 commit 4924fa0

File tree

5 files changed

+9
-7
lines changed

5 files changed

+9
-7
lines changed

src/Frontend/src/components/CodeEditor.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ const props = withDefaults(
1818
readOnly?: boolean;
1919
showGutter?: boolean;
2020
showCopyToClipboard?: boolean;
21+
ariaLabel?: string;
2122
}>(),
2223
{ readOnly: true, showGutter: true, showCopyToClipboard: true }
2324
);
@@ -48,7 +49,7 @@ const extensions = computed(() => {
4849
</script>
4950

5051
<template>
51-
<div class="wrapper">
52+
<div class="wrapper" :aria-label="ariaLabel">
5253
<div v-if="props.showCopyToClipboard" class="toolbar">
5354
<CopyToClipboard :value="code" />
5455
</div>

src/Frontend/src/components/CopyToClipboard.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ async function copyToClipboard() {
1919

2020
<template>
2121
<Tippy content="Copied" ref="tippyRef" trigger="manual">
22-
<button type="button" class="btn btn-sm" @click="copyToClipboard"><i class="fa fa-copy"></i> Copy to clipboard</button>
22+
<button type="button" class="btn btn-secondary btn-sm" @click="copyToClipboard"><i class="fa fa-copy"></i> Copy to clipboard</button>
2323
</Tippy>
2424
</template>

src/Frontend/src/components/failedmessages/EditRetryDialog.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ onMounted(() => {
231231
</table>
232232
<div role="tabpanel" v-if="panel === 2 && !localMessage.bodyUnavailable" style="height: calc(100% - 260px)">
233233
<div style="margin-top: 20px">
234-
<CodeEditor role="textbox" aria-label="message body" :read-only="!localMessage.isContentTypeSupported" v-model="localMessage.messageBody" :language="localMessage.language" :show-gutter="true"></CodeEditor>
234+
<CodeEditor aria-label="message body" :read-only="!localMessage.isContentTypeSupported" v-model="localMessage.messageBody" :language="localMessage.language" :show-gutter="true"></CodeEditor>
235235
</div>
236236
<span class="empty-error" v-if="localMessage.isBodyEmpty"><i class="fa fa-exclamation-triangle"></i> Message body cannot be empty</span>
237237
<span class="reset-body" v-if="localMessage.isBodyChanged"><i class="fa fa-undo" v-tippy="`Reset changes`"></i> <a @click="resetBodyChanges()" href="javascript:void(0)">Reset changes</a></span>

src/Frontend/test/specs/failedmessages/edit-and-retry.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ describe("FEATURE: Editing failed messages", () => {
7777
await messageEditor.switchToMessageBodyTab();
7878

7979
//Then The message body should be editable
80-
expect(messageEditor.bodyFieldIsDisabled()).toBeFalsy();
80+
expect(messageEditor.bodyFieldIsReadOnly()).toBeFalsy();
8181
});
8282
});
8383

@@ -103,7 +103,7 @@ describe("FEATURE: Editing failed messages", () => {
103103
await messageEditor.switchToMessageBodyTab();
104104

105105
//Then The message body should NOT be editable
106-
expect(messageEditor.bodyFieldIsDisabled()).toBeTruthy();
106+
expect(messageEditor.bodyFieldIsReadOnly()).toBeTruthy();
107107
expect(
108108
messageEditor.hasWarningMatchingText(/message body cannot be edited because content type "application\/octet-stream" is not supported\. only messages with content types "application\/json" and "text\/xml" can be edited\./i)
109109
).toBeTruthy();

src/Frontend/test/specs/failedmessages/questions/getEditAndRetryEditor.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ export async function getEditAndRetryEditor() {
99
await UserEvent.click(tab);
1010
},
1111

12-
bodyFieldIsDisabled() {
13-
return within(dialog).getByRole("textbox", { name: "message body" }).hasAttribute("readonly");
12+
bodyFieldIsReadOnly() {
13+
const textbox = within(within(dialog).getByLabelText("message body")).getByRole("textbox");
14+
return textbox.ariaReadOnly === "true";
1415
},
1516

1617
hasWarningMatchingText(legendText: RegExp) {

0 commit comments

Comments
 (0)