Skip to content

Commit 37dd5b0

Browse files
fix: reverted "archive-doc-gen" changes
1 parent 9551afb commit 37dd5b0

6 files changed

Lines changed: 28 additions & 23 deletions

File tree

archive-doc-gen/src/backend/settings.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -267,10 +267,6 @@ class _AzureSearchSettings(BaseSettings, DatasourcePayloadConstructor):
267267
env_ignore_empty=True,
268268
)
269269

270-
def __init__(self, *args, settings: "_AppSettings", **data):
271-
# Ensure DatasourcePayloadConstructor.__init__ runs so that _settings is initialized
272-
super().__init__(*args, settings=settings, **data)
273-
274270
_type: Literal["azure_search"] = PrivateAttr(default="azure_search")
275271
top_k: int = Field(default=5, serialization_alias="top_n_documents")
276272
strictness: int = 3

archive-doc-gen/src/frontend/src/components/ChatHistory/ChatHistoryListItem.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
DialogType,
88
IconButton,
99
ITextField,
10+
ITooltipHostStyles,
1011
List,
1112
PrimaryButton,
1213
Separator,

archive-doc-gen/src/frontend/src/components/ChatHistory/chatHistoryListItem.test.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,8 @@ describe('ChatHistoryListItemCell', () => {
553553
}, 10000)
554554

555555
test('shows error when trying to rename to an existing title', async () => {
556-
(historyRename as jest.Mock).mockResolvedValueOnce({
556+
const existingTitle = 'Existing Chat Title'
557+
;(historyRename as jest.Mock).mockResolvedValueOnce({
557558
ok: false,
558559
json: async () => ({ message: 'Title already exists' })
559560
})

archive-doc-gen/src/frontend/src/pages/chat/Chat.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ import {
66
Dialog,
77
DialogType,
88
Stack,
9+
IStackTokens,
10+
mergeStyleSets,
11+
IModalStyles,
912
Spinner,
1013
SpinnerSize
1114
} from '@fluentui/react'

archive-doc-gen/tests/e2e-test/pages/draftPage.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import time
2+
import os
23
from base.base import BasePage
34
from pytest_check import check
45
from playwright.sync_api import expect

archive-doc-gen/tests/e2e-test/tests/test_st_docgen_tc.py

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import pytest
77
from pytest_check import check
88
from playwright.sync_api import expect
9-
from config.constants import (add_section, browse_question1, browse_question2, browse_question3,
9+
from config.constants import (URL, add_section, browse_question1, browse_question2, browse_question3,
1010
browse_question4, browse_question5, generate_question1, invalid_response,
1111
invalid_response1, remove_section)
1212
from pages.browsePage import BrowsePage
@@ -538,6 +538,7 @@ def test_show_hide_chat_history(login_logout, request):
538538

539539
page = login_logout
540540
home_page = HomePage(page)
541+
browse_page = BrowsePage(page)
541542
generate_page = GeneratePage(page)
542543

543544
log_capture = io.StringIO()
@@ -2502,13 +2503,15 @@ def test_bug_7571_removed_sections_not_returning(request, login_logout):
25022503
logger.info("Step 4: Enter a prompt to remove sections one by one 'Remove (section name)'")
25032504
start = time.time()
25042505

2505-
# Select up to 3 sections to remove from the initial list (avoid removing first section for stability)
2506-
indices_to_remove = [1, 2, 3] if initial_count > 3 else list(range(1, initial_count))
2507-
sections_to_remove = [
2508-
initial_sections[idx]
2509-
for idx in indices_to_remove
2510-
if idx < len(initial_sections)
2511-
]
2506+
# Select 3 sections to remove from the initial list
2507+
sections_to_remove = []
2508+
2509+
if initial_count >= 3:
2510+
# Remove sections at positions 1, 2, and 3 (avoid removing first section for stability)
2511+
indices_to_remove = [1, 2, 3] if initial_count > 3 else list(range(1, initial_count))
2512+
for idx in indices_to_remove:
2513+
if idx < len(initial_sections):
2514+
sections_to_remove.append(initial_sections[idx])
25122515

25132516
logger.info("Sections selected for removal: %s", sections_to_remove)
25142517

@@ -3399,7 +3402,7 @@ def test_bug_10177_edit_delete_icons_disabled_during_response(login_logout, requ
33993402
try:
34003403
threads.first.wait_for(state="visible", timeout=10000)
34013404
logger.info("✅ Chat history created and displayed with %d thread(s)", threads.count())
3402-
except Exception:
3405+
except:
34033406
logger.error("❌ Chat history threads not visible after creation")
34043407
# Try alternative locator
34053408
threads_alt = page.locator('div[data-list-index]')
@@ -3449,7 +3452,7 @@ def test_bug_10177_edit_delete_icons_disabled_during_response(login_logout, requ
34493452
try:
34503453
delete_icon.wait_for(state="visible", timeout=2000)
34513454
is_delete_visible = True
3452-
except Exception:
3455+
except:
34533456
is_delete_visible = False
34543457

34553458
is_delete_enabled = delete_icon.is_enabled() if is_delete_visible else False
@@ -3461,7 +3464,7 @@ def test_bug_10177_edit_delete_icons_disabled_during_response(login_logout, requ
34613464
try:
34623465
edit_icon.wait_for(state="visible", timeout=2000)
34633466
is_edit_visible = True
3464-
except Exception:
3467+
except:
34653468
is_edit_visible = False
34663469

34673470
is_edit_enabled = edit_icon.is_enabled() if is_edit_visible else False
@@ -3915,9 +3918,7 @@ def test_bug_16106_tooltip_on_chat_history_hover(login_logout, request):
39153918
with check:
39163919
assert thread_count > 0, "No chat history threads found to hover over"
39173920

3918-
if thread_count <= 0:
3919-
logger.warning("Skipping hover action: no chat history threads available.")
3920-
else:
3921+
if thread_count > 0:
39213922
# Hover over the first chat thread to trigger tooltip
39223923
first_thread = history_threads.nth(0)
39233924
first_thread.hover()
@@ -3992,6 +3993,8 @@ def test_bug_16106_tooltip_on_chat_history_hover(login_logout, request):
39923993
if tooltip_found:
39933994
logger.info("✅ Tooltip displayed successfully on chat history hover")
39943995
logger.info("Tooltip text length: %d characters", len(tooltip_text))
3996+
else:
3997+
logger.error("❌ BUG FOUND: No tooltip displayed when hovering over chat history")
39953998

39963999
duration = time.time() - start
39974000
logger.info("Execution Time for 'Verify tooltip': %.2fs", duration)
@@ -4008,7 +4011,7 @@ def test_bug_16106_tooltip_on_chat_history_hover(login_logout, request):
40084011
page.keyboard.press("Escape")
40094012
page.wait_for_timeout(1000)
40104013
logger.info("Closed chat history using Escape key")
4011-
except Exception:
4014+
except:
40124015
logger.warning("Chat history panel may still be open")
40134016

40144017
logger.info("\n%s", "="*80)
@@ -4103,10 +4106,10 @@ def test_bug_26031_validate_empty_spaces_chat_input(login_logout, request):
41034106
assert current_responses_empty == initial_responses, \
41044107
f"BUG: System accepted empty query. Response count changed from {initial_responses} to {current_responses_empty}"
41054108

4106-
if current_responses_empty != initial_responses:
4107-
logger.error("❌ BUG: System accepted empty query and generated response")
4108-
else:
4109+
if current_responses_empty == initial_responses:
41094110
logger.info("✅ System did not accept empty query - no response generated")
4111+
else:
4112+
logger.error("❌ BUG: System accepted empty query and generated response")
41104113
else:
41114114
logger.info("✅ Send button is properly disabled for empty input")
41124115

0 commit comments

Comments
 (0)