Compare commits

...

2 Commits

Author SHA1 Message Date
Yunus M
eb19a00c7a feat: update test cases 2025-12-26 15:08:00 +05:30
Yunus M
c22366cbf4 feat: default max lines to 1 2025-12-26 15:03:31 +05:30
17 changed files with 26 additions and 26 deletions

View File

@@ -59,7 +59,7 @@ jest.mock('providers/preferences/sync/usePreferenceSync', () => ({
preferences: {
columns: [],
formatting: {
maxLines: 2,
maxLines: 1,
format: 'table',
fontSize: 'small',
version: 1,

View File

@@ -10,7 +10,7 @@ jest.mock('providers/preferences/sync/usePreferenceSync', () => ({
preferences: {
columns: [],
formatting: {
maxLines: 2,
maxLines: 1,
format: 'table',
fontSize: 'small',
version: 1,
@@ -51,7 +51,7 @@ describe('LogsFormatOptionsMenu (unit)', () => {
selectedOptionFormat="table"
config={{
format: { value: 'table', onChange: formatOnChange },
maxLines: { value: 2, onChange: maxLinesOnChange },
maxLines: { value: 1, onChange: maxLinesOnChange },
fontSize: { value: FontSize.SMALL, onChange: fontSizeOnChange },
addColumn: {
isFetching: false,

View File

@@ -35,7 +35,7 @@ jest.mock('providers/preferences/sync/usePreferenceSync', () => ({
preferences: {
columns: [],
formatting: {
maxLines: 2,
maxLines: 1,
format: 'table',
fontSize: 'small',
version: 1,

View File

@@ -119,7 +119,7 @@ jest.mock('providers/preferences/sync/usePreferenceSync', () => ({
preferences: {
columns: [],
formatting: {
maxLines: 2,
maxLines: 1,
format: 'table',
fontSize: 'small',
version: 1,

View File

@@ -37,7 +37,7 @@ describe('useOptionsMenu', () => {
columns: [],
formatting: {
format: 'raw',
maxLines: 2,
maxLines: 1,
fontSize: 'small',
},
},
@@ -49,7 +49,7 @@ describe('useOptionsMenu', () => {
columns: [],
formatting: {
format: 'raw',
maxLines: 2,
maxLines: 1,
fontSize: 'small',
},
},

View File

@@ -7,7 +7,7 @@ export const URL_OPTIONS = 'options';
export const defaultOptionsQuery: OptionsQuery = {
selectColumns: [],
maxLines: 2,
maxLines: 1,
format: 'raw',
fontSize: FontSize.SMALL,
};

View File

@@ -62,7 +62,7 @@ jest.mock('providers/preferences/sync/usePreferenceSync', () => ({
preferences: {
columns: [],
formatting: {
maxLines: 2,
maxLines: 1,
format: 'table',
fontSize: 'small',
version: 1,

View File

@@ -68,7 +68,7 @@ jest.mock('providers/preferences/sync/usePreferenceSync', () => ({
preferences: {
columns: [],
formatting: {
maxLines: 2,
maxLines: 1,
format: 'table',
fontSize: 'small',
version: 1,

View File

@@ -59,7 +59,7 @@ export const optionMenuReturn = {
id: 'dbName--string--tag--true',
},
],
maxLines: 2,
maxLines: 1,
format: 'list',
},
handleOptionsChange: jest.fn(),

View File

@@ -160,7 +160,7 @@ describe('logsLoaderConfig', () => {
expect(result).toEqual({
columns: defaultLogsSelectedColumns,
formatting: {
maxLines: 2,
maxLines: 1,
format: 'table' as LogViewMode,
fontSize: 'small' as FontSize,
version: 1,

View File

@@ -41,7 +41,7 @@ describe('logsUpdaterConfig', () => {
const mockPreferences: Preferences = {
columns: [],
formatting: {
maxLines: 2,
maxLines: 1,
format: 'table' as LogViewMode,
fontSize: 'small' as FontSize,
version: 1,
@@ -80,7 +80,7 @@ describe('logsUpdaterConfig', () => {
dataType: DataTypes.String,
},
],
maxLines: 2,
maxLines: 1,
});
logsUpdater.updateColumns(newColumns, PreferenceMode.DIRECT);
@@ -97,7 +97,7 @@ describe('logsUpdaterConfig', () => {
mockLocalStorage[LOCALSTORAGE.LOGS_LIST_OPTIONS],
);
expect(storedData.selectColumns).toEqual(newColumns);
expect(storedData.maxLines).toBe(2); // Should preserve other fields
expect(storedData.maxLines).toBe(1); // Should preserve other fields
// Should not update saved view preferences
expect(setSavedViewPreferences).not.toHaveBeenCalled();
@@ -153,7 +153,7 @@ describe('logsUpdaterConfig', () => {
dataType: DataTypes.String,
},
],
maxLines: 2,
maxLines: 1,
format: 'table',
});
@@ -206,7 +206,7 @@ describe('logsUpdaterConfig', () => {
dataType: DataTypes.String,
},
],
maxLines: 2,
maxLines: 1,
format: 'table',
});
@@ -216,7 +216,7 @@ describe('logsUpdaterConfig', () => {
const storedData = JSON.parse(
mockLocalStorage[LOCALSTORAGE.LOGS_LIST_OPTIONS],
);
expect(storedData.maxLines).toBe(2); // Should remain the same
expect(storedData.maxLines).toBe(1); // Should remain the same
expect(storedData.format).toBe('table'); // Should remain the same
// Should update saved view preferences

View File

@@ -113,7 +113,7 @@ describe('tracesUpdaterConfig', () => {
expect(mockSetSavedViewPreferences).toHaveBeenCalledWith({
columns: mockColumns,
formatting: {
maxLines: 2,
maxLines: 1,
format: 'table',
fontSize: 'small',
version: 1,

View File

@@ -46,7 +46,7 @@ describe('usePreferenceUpdater', () => {
const mockPreferences: Preferences = {
columns: [],
formatting: {
maxLines: 2,
maxLines: 1,
format: 'table' as LogViewMode,
fontSize: 'small' as FontSize,
version: 1,

View File

@@ -39,7 +39,7 @@ const logsLoaders = {
return {
columns: validLogColumns.length > 0 ? validLogColumns : [],
formatting: {
maxLines: parsed.maxLines ?? 2,
maxLines: parsed.maxLines ?? 1,
format: parsed.format ?? 'table',
fontSize: parsed.fontSize ?? 'small',
version: parsed.version ?? 1,
@@ -65,7 +65,7 @@ const logsLoaders = {
return {
columns: validLogColumns.length > 0 ? validLogColumns : [],
formatting: {
maxLines: options.maxLines ?? 2,
maxLines: options.maxLines ?? 1,
format: options.format ?? 'table',
fontSize: options.fontSize ?? 'small',
version: options.version ?? 1,
@@ -80,7 +80,7 @@ const logsLoaders = {
} => ({
columns: defaultLogsSelectedColumns,
formatting: {
maxLines: 2,
maxLines: 1,
format: 'table',
fontSize: 'small' as FontSize,
version: 1,

View File

@@ -23,7 +23,7 @@ const getLogsUpdaterConfig = (
return {
columns: newColumns,
formatting: {
maxLines: 2,
maxLines: 1,
format: 'table',
fontSize: 'small' as FontSize,
version: 1,

View File

@@ -21,7 +21,7 @@ const getTracesUpdaterConfig = (
setSavedViewPreferences({
columns: newColumns,
formatting: {
maxLines: 2,
maxLines: 1,
format: 'table',
fontSize: 'small' as FontSize,
version: 1,

View File

@@ -58,7 +58,7 @@ export function usePreferenceSync({
updateExtraDataSelectColumns(parsedExtraData?.selectColumns) ||
defaultLogsSelectedColumns;
formatting = {
maxLines: parsedExtraData?.maxLines ?? 2,
maxLines: parsedExtraData?.maxLines ?? 1,
format: parsedExtraData?.format ?? 'table',
fontSize: parsedExtraData?.fontSize ?? 'small',
version: parsedExtraData?.version ?? 1,