Skip to content

Commit c383062

Browse files
Shibani Basavashibbas
authored andcommitted
chore: fix tests and citations
1 parent 33fba85 commit c383062

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

packages/chat-component/src/components/chat-component.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export class ChatComponent extends LitElement {
5656
}
5757

5858
@property({ type: String, attribute: 'data-api-url' })
59-
set apiUrl(value: string = chatHttpOptions.url) {
59+
set apiUrl(value: string) {
6060
this.chatContext.apiUrl = value;
6161
}
6262

@@ -172,8 +172,14 @@ export class ChatComponent extends LitElement {
172172

173173
handleCitationClick(event: CustomEvent): void {
174174
event?.preventDefault();
175-
this.chatContext.selectedCitation = event?.detail?.citation;
176-
this.chatContext.selectedChatEntry = event?.detail?.chatThreadEntry;
175+
const citation = event?.detail?.citation;
176+
const chatThreadEntry = event?.detail?.chatThreadEntry;
177+
if (citation) {
178+
this.chatContext.selectedCitation = citation;
179+
}
180+
if (chatThreadEntry) {
181+
this.chatContext.selectedChatEntry = chatThreadEntry;
182+
}
177183
this.chatContext.setState('showCitations', true);
178184
}
179185

packages/chat-component/src/components/chat-context.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { type ReactiveController, type ReactiveControllerHost } from 'lit';
2+
import { chatHttpOptions } from '../config/global-config.js';
23

34
export class ChatContextController implements ReactiveController {
45
host: ReactiveControllerHost;
@@ -19,7 +20,7 @@ export class ChatContextController implements ReactiveController {
1920

2021
private _selectedChatEntry: ChatThreadEntry | undefined = undefined;
2122

22-
private _apiUrl: string = '';
23+
private _apiUrl: string = chatHttpOptions.url;
2324

2425
private _interactionModel: 'ask' | 'chat' = 'chat';
2526

tests/e2e/webapp.spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,6 @@ test.describe('generate answer', () => {
438438

439439
test('follow up questions', async ({ page }) => {
440440
const followupQuestions = page.getByTestId('followUpQuestion');
441-
await followupQuestions.waitFor();
442441

443442
await expect(followupQuestions).toHaveCount(3);
444443

0 commit comments

Comments
 (0)