diff --git a/spring-boot-admin-server-ui/src/main/frontend/views/instances/logfile/index.spec.ts b/spring-boot-admin-server-ui/src/main/frontend/views/instances/logfile/index.spec.ts new file mode 100644 index 00000000000..11aed994646 --- /dev/null +++ b/spring-boot-admin-server-ui/src/main/frontend/views/instances/logfile/index.spec.ts @@ -0,0 +1,29 @@ +import { screen, waitFor } from '@testing-library/vue'; +import { beforeEach, describe, expect, it } from 'vitest'; + +import { applications } from '@/mocks/applications/data'; +import Application from '@/services/application'; +import { render } from '@/test-utils'; +import LogFile from '@/views/instances/logfile/index.vue'; + +describe('LogFile', () => { + beforeEach(async () => { + const application = new Application(applications[0]); + const instance = application.instances[0]; + + render(LogFile, { + props: { + instance, + }, + }); + }); + + it('disables the wrap lines by default', async () => { + const checkbox = await screen.findByRole('checkbox', { + name: 'instances.logfile.wrap_lines', + }); + await waitFor(() => { + expect(checkbox).not.toBeChecked(); + }); + }); +}); diff --git a/spring-boot-admin-server-ui/src/main/frontend/views/instances/logfile/index.vue b/spring-boot-admin-server-ui/src/main/frontend/views/instances/logfile/index.vue index aa3f5cb1a08..7be1704531e 100644 --- a/spring-boot-admin-server-ui/src/main/frontend/views/instances/logfile/index.vue +++ b/spring-boot-admin-server-ui/src/main/frontend/views/instances/logfile/index.vue @@ -130,8 +130,8 @@ export default { atBottom: false, atTop: true, skippedBytes: null, - wrapLines: true, - scrollSubcription: null, + wrapLines: false, + scrollSubscription: null, }), computed: { skippedBytesString() { @@ -143,7 +143,7 @@ export default { }, created() { this.ansiUp = new AnsiUp(); - this.scrollSubcription = fromEvent(window, 'scroll') + this.scrollSubscription = fromEvent(window, 'scroll') .pipe( debounceTime(25), map((event) => event.target.scrollingElement.scrollTop), @@ -157,11 +157,11 @@ export default { }); }, beforeUnmount() { - if (this.scrollSubcription && !this.scrollSubcription.closed) { + if (this.scrollSubscription && !this.scrollSubscription.closed) { try { - this.scrollSubcription.unsubscribe(); + this.scrollSubscription.unsubscribe(); } finally { - this.scrollSubcription = null; + this.scrollSubscription = null; } } },