diff --git a/resources/js/vue/components/BuildNotesPage.vue b/resources/js/vue/components/BuildNotesPage.vue
index c507b9d3a0..2b68b09743 100644
--- a/resources/js/vue/components/BuildNotesPage.vue
+++ b/resources/js/vue/components/BuildNotesPage.vue
@@ -49,7 +49,7 @@
:id="note.node.id"
:key="note.node.id"
:ref="r => noteRefs.push(r)"
- class="tw-border tw-border-base-300 tw-bg-base-100 tw-rounded-box tw-scroll-mt-28"
+ class="tw-border tw-border-base-300 tw-bg-base-100 tw-rounded-box tw-scroll-mt-28 tw-overflow-hidden"
data-test="notes-content-item"
>
diff --git a/resources/js/vue/components/shared/CodeBox.vue b/resources/js/vue/components/shared/CodeBox.vue
index e8efcc132c..d64168c1cb 100644
--- a/resources/js/vue/components/shared/CodeBox.vue
+++ b/resources/js/vue/components/shared/CodeBox.vue
@@ -1,15 +1,13 @@
+ class="tw-font-mono tw-bg-gray-100 tw-p-2 tw-whitespace-pre-wrap tw-break-all tw-overflow-hidden"
+ :class="{ 'tw-border': bordered, 'tw-rounded': bordered }"
+ >
+ {{ text }}
+
diff --git a/tests/cypress/component/code-box.cy.js b/tests/cypress/component/code-box.cy.js
index 9aa9a568d0..615f381c85 100644
--- a/tests/cypress/component/code-box.cy.js
+++ b/tests/cypress/component/code-box.cy.js
@@ -10,8 +10,7 @@ describe('CodeBox', () => {
},
});
- cy.get('.cm-editor').should('be.visible');
- cy.get('.cm-content').should('contain.text', 'Hello, World!');
+ cy.contains('Hello, World!').should('exist');
});
it('updates the content when the text prop changes', () => {
@@ -23,11 +22,11 @@ describe('CodeBox', () => {
text: initialCode,
},
}).then(({ wrapper }) => {
- cy.get('.cm-content').should('contain.text', 'const a = 1;');
+ cy.contains('const a = 1;').should('exist');
wrapper.setProps({ text: updatedCode });
// Wait for the DOM to update before asserting the new content.
- cy.get('.cm-content').should('not.contain.text', 'const a = 1;').then(() => {
- cy.get('.cm-content').should('contain.text', 'const b = 2;');
+ cy.contains('const a = 1;').should('not.exist').then(() => {
+ cy.contains('const b = 2;').should('exist');
});
});
});