mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-09-30 03:01:21 +02:00
Fixed frontend/backend tests
This commit is contained in:
@@ -212,7 +212,7 @@ def _read_log_entries(
|
||||
if parsed:
|
||||
# Found a new log entry start
|
||||
if current_entry:
|
||||
# Apply filters and add previous entry
|
||||
# Apply filters and add previous entry (without multi_line_buffer - it belongs to new entry)
|
||||
should_include = True
|
||||
|
||||
# Level filter
|
||||
@@ -229,21 +229,23 @@ def _read_log_entries(
|
||||
should_include = False
|
||||
|
||||
if should_include:
|
||||
# Append any multi-line content
|
||||
if multi_line_buffer:
|
||||
current_entry.message += "\n" + "\n".join(reversed(multi_line_buffer))
|
||||
entries.append(current_entry)
|
||||
|
||||
if len(entries) >= limit:
|
||||
break
|
||||
|
||||
# Set new entry and attach any accumulated multi-line content to it
|
||||
# (in reverse order, continuation lines come before their parent entry)
|
||||
current_entry = parsed
|
||||
if multi_line_buffer:
|
||||
current_entry.message += "\n" + "\n".join(reversed(multi_line_buffer))
|
||||
multi_line_buffer = []
|
||||
elif current_entry and line.strip():
|
||||
# Continuation of multi-line log entry
|
||||
elif line.strip():
|
||||
# Continuation of multi-line log entry (will be attached to next parsed entry)
|
||||
multi_line_buffer.append(line.rstrip())
|
||||
|
||||
# Don't forget the last (oldest) entry
|
||||
# Note: any remaining multi_line_buffer would be orphaned lines before the first entry
|
||||
if current_entry and len(entries) < limit:
|
||||
should_include = True
|
||||
if level_filter and current_entry.level.upper() != level_filter.upper():
|
||||
@@ -256,8 +258,6 @@ def _read_log_entries(
|
||||
):
|
||||
should_include = False
|
||||
if should_include:
|
||||
if multi_line_buffer:
|
||||
current_entry.message += "\n" + "\n".join(reversed(multi_line_buffer))
|
||||
entries.append(current_entry)
|
||||
|
||||
except Exception as e:
|
||||
|
||||
@@ -454,7 +454,7 @@ describe('PrintModal', () => {
|
||||
expect(mockOnClose).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('shows printer dropdown for single selection', async () => {
|
||||
it('shows printer selector for single selection', async () => {
|
||||
const item = createMockQueueItem();
|
||||
|
||||
render(
|
||||
@@ -467,8 +467,9 @@ describe('PrintModal', () => {
|
||||
/>
|
||||
);
|
||||
|
||||
// PrinterSelector shows printer names directly
|
||||
await waitFor(() => {
|
||||
expect(screen.getByText('Printer')).toBeInTheDocument();
|
||||
expect(screen.getByText('P1S')).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -489,7 +490,7 @@ describe('PrintModal', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('shows info message when multiple printers selected', async () => {
|
||||
it('shows selected count when multiple printers selected', async () => {
|
||||
const user = userEvent.setup();
|
||||
render(
|
||||
<PrintModal
|
||||
@@ -507,7 +508,7 @@ describe('PrintModal', () => {
|
||||
await user.click(screen.getByText('Select all'));
|
||||
|
||||
await waitFor(() => {
|
||||
expect(screen.getByText(/Slot mapping below applies to all/)).toBeInTheDocument();
|
||||
expect(screen.getByText(/2 printers selected/)).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user