mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
fix(editor): Adjust time format for negative numbers (no-changelog) (#16194)
This commit is contained in:
@@ -3,6 +3,7 @@ import { I18nClass } from './index';
|
||||
describe(I18nClass, () => {
|
||||
describe('displayTimer', () => {
|
||||
it('should format duration with hours, minutes and seconds', () => {
|
||||
expect(new I18nClass().displayTimer(-1)).toBe('-1s');
|
||||
expect(new I18nClass().displayTimer(0)).toBe('0s');
|
||||
expect(new I18nClass().displayTimer(12)).toBe('0s');
|
||||
expect(new I18nClass().displayTimer(123)).toBe('0s');
|
||||
|
||||
@@ -107,11 +107,9 @@ export class I18nClass {
|
||||
remainingMs = remainingMs % minute;
|
||||
}
|
||||
|
||||
if (!showMs) {
|
||||
remainingMs -= remainingMs % second;
|
||||
}
|
||||
const remainingSec = showMs ? remainingMs / second : Math.floor(remainingMs / second);
|
||||
|
||||
parts.push(`${remainingMs / second}${this.baseText('genericHelpers.secShort')}`);
|
||||
parts.push(`${remainingSec}${this.baseText('genericHelpers.secShort')}`);
|
||||
|
||||
return parts.join(' ');
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import type { IDataObject } from 'n8n-workflow';
|
||||
|
||||
import type { IRestApiContext } from '../types';
|
||||
import { makeRestApiRequest } from '../utils';
|
||||
import type { IDataObject } from 'n8n-workflow';
|
||||
|
||||
export interface LdapSyncData {
|
||||
id: number;
|
||||
|
||||
@@ -284,6 +284,6 @@ export async function streamRequest<T extends object>(
|
||||
}
|
||||
} catch (e: unknown) {
|
||||
assert(e instanceof Error);
|
||||
onError?.(e as Error);
|
||||
onError?.(e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -199,6 +199,6 @@ describe('GlobalExecutionsListItem', () => {
|
||||
|
||||
const executionTimeElement = getByTestId('execution-time');
|
||||
expect(executionTimeElement).toBeVisible();
|
||||
expect(executionTimeElement.textContent).toBe('30:00m');
|
||||
expect(executionTimeElement.textContent).toBe('30m 0s');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user