Skip to content

Commit

Permalink
chore: fix tests and citations
Browse files Browse the repository at this point in the history
  • Loading branch information
Shibani Basava authored and Shibani Basava committed Feb 13, 2024
1 parent a8ce365 commit a7840b3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
12 changes: 9 additions & 3 deletions packages/chat-component/src/components/chat-component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export class ChatComponent extends LitElement {
}

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

Expand Down Expand Up @@ -172,8 +172,14 @@ export class ChatComponent extends LitElement {

handleCitationClick(event: CustomEvent): void {
event?.preventDefault();
this.chatContext.selectedCitation = event?.detail?.citation;
this.chatContext.selectedChatEntry = event?.detail?.chatThreadEntry;
const citation = event?.detail?.citation;
const chatThreadEntry = event?.detail?.chatThreadEntry;
if (citation) {
this.chatContext.selectedCitation = citation;
}
if (chatThreadEntry) {
this.chatContext.selectedChatEntry = chatThreadEntry;
}
this.chatContext.setState('showCitations', true);
}

Expand Down
3 changes: 2 additions & 1 deletion packages/chat-component/src/components/chat-context.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { type ReactiveController, type ReactiveControllerHost } from 'lit';
import { chatHttpOptions } from '../config/global-config.js';

export class ChatContextController implements ReactiveController {
host: ReactiveControllerHost;
Expand All @@ -19,7 +20,7 @@ export class ChatContextController implements ReactiveController {

private _selectedChatEntry: ChatThreadEntry | undefined = undefined;

private _apiUrl: string = '';
private _apiUrl: string = chatHttpOptions.url;

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

Expand Down
1 change: 0 additions & 1 deletion tests/e2e/webapp.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,6 @@ test.describe('generate answer', () => {

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

await expect(followupQuestions).toHaveCount(3);

Expand Down

0 comments on commit a7840b3

Please sign in to comment.