fix(editor): Fix workflow history TS errors (#9433)

This commit is contained in:
Csaba Tuncsik 2024-05-17 10:59:01 +02:00 committed by GitHub
parent 596c472ecc
commit bc05faf0a6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 5 additions and 4 deletions

View file

@ -138,7 +138,7 @@ const onItemMounted = ({
<span>
{{
i18n.baseText('workflowHistory.limit', {
interpolate: { evaluatedPruneTime: props.evaluatedPruneTime },
interpolate: { evaluatedPruneTime: String(props.evaluatedPruneTime) },
})
}}
</span>

View file

@ -86,7 +86,7 @@ onMounted(() => {
isActive: props.isActive,
});
isAuthorElementTruncated.value =
authorElement.value?.scrollWidth > authorElement.value?.clientWidth;
(authorElement.value?.scrollWidth ?? 0) > (authorElement.value?.clientWidth ?? 0);
});
</script>
<template>

View file

@ -1,4 +1,5 @@
import { vi } from 'vitest';
import type { MockInstance } from 'vitest';
import { createPinia, setActivePinia } from 'pinia';
import { waitFor } from '@testing-library/vue';
import userEvent from '@testing-library/user-event';
@ -19,7 +20,7 @@ const actions: UserAction[] = actionTypes.map((value) => ({
const renderComponent = createComponentRenderer(WorkflowHistoryContent);
let pinia: ReturnType<typeof createPinia>;
let postMessageSpy: vi.SpyInstance;
let postMessageSpy: MockInstance;
describe('WorkflowHistoryContent', () => {
beforeEach(() => {

View file

@ -31,7 +31,7 @@ let pinia: ReturnType<typeof createPinia>;
describe('WorkflowHistoryList', () => {
beforeAll(() => {
Element.prototype.scrollTo = vi.fn();
Element.prototype.scrollTo = vi.fn(() => {});
});
beforeEach(() => {