Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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();
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ export default {
atBottom: false,
atTop: true,
skippedBytes: null,
wrapLines: true,
scrollSubcription: null,
wrapLines: false,
scrollSubscription: null,
}),
computed: {
skippedBytesString() {
Expand All @@ -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),
Expand All @@ -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;
}
}
},
Expand Down