mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 12:28:42 +00:00
feat(server): add real-world prompt test for copilot apis (#8629)
fix AF-1432, PD-1176
This commit is contained in:
@@ -153,6 +153,9 @@ export class ChatActionList extends LitElement {
|
||||
});
|
||||
}
|
||||
}}
|
||||
data-testid="action-${action.title
|
||||
.toLowerCase()
|
||||
.replaceAll(' ', '-')}"
|
||||
>
|
||||
${action.title}
|
||||
</div>
|
||||
|
||||
@@ -178,13 +178,17 @@ export class ChatCopyMore extends WithDisposable(LitElement) {
|
||||
this._notifySuccess('Copied to clipboard');
|
||||
}
|
||||
}}
|
||||
data-testid="action-copy-button"
|
||||
>
|
||||
${CopyIcon}
|
||||
<affine-tooltip>Copy</affine-tooltip>
|
||||
</div>`
|
||||
: nothing}
|
||||
${isLast
|
||||
? html`<div @click=${() => this.retry()}>
|
||||
? html`<div
|
||||
@click=${() => this.retry()}
|
||||
data-testid="action-retry-button"
|
||||
>
|
||||
${RetryIcon}
|
||||
<affine-tooltip>Retry</affine-tooltip>
|
||||
</div>`
|
||||
|
||||
@@ -371,6 +371,7 @@ export class ChatPanelInput extends WithDisposable(LitElement) {
|
||||
}
|
||||
}
|
||||
}}
|
||||
data-testid="chat-panel-input"
|
||||
></textarea>
|
||||
<div class="chat-panel-input-actions">
|
||||
<div
|
||||
@@ -378,6 +379,7 @@ export class ChatPanelInput extends WithDisposable(LitElement) {
|
||||
@click=${async () => {
|
||||
await this.cleanupHistories();
|
||||
}}
|
||||
data-testid="chat-panel-clear"
|
||||
>
|
||||
${ChatClearIcon}
|
||||
</div>
|
||||
@@ -410,6 +412,7 @@ export class ChatPanelInput extends WithDisposable(LitElement) {
|
||||
@click="${this.send}"
|
||||
class="chat-panel-send"
|
||||
aria-disabled=${this.isInputEmpty}
|
||||
data-testid="chat-panel-send"
|
||||
>
|
||||
${ChatSendIcon}
|
||||
</div>`}
|
||||
|
||||
@@ -379,7 +379,7 @@ export class ChatPanelMessages extends WithDisposable(ShadowlessElement) {
|
||||
: html`<div class="avatar"></div>`}
|
||||
</div>`
|
||||
: AffineAvatarIcon}
|
||||
${isUser ? 'You' : 'AFFINE AI'}
|
||||
${isUser ? 'You' : 'AFFiNE AI'}
|
||||
</div>`;
|
||||
}
|
||||
|
||||
|
||||
@@ -244,7 +244,7 @@ export class ChatPanel extends WithDisposable(ShadowlessElement) {
|
||||
override render() {
|
||||
return html` <div class="chat-panel-container">
|
||||
<div class="chat-panel-title">
|
||||
<div>AFFINE AI</div>
|
||||
<div>AFFiNE AI</div>
|
||||
<div
|
||||
@click=${() => {
|
||||
AIProvider.toggleGeneralAIOnboarding?.(true);
|
||||
|
||||
@@ -34,6 +34,7 @@ const ToggleButton = ({
|
||||
onClick={onToggle}
|
||||
className={className}
|
||||
data-show={show}
|
||||
data-testid="right-sidebar-toggle"
|
||||
>
|
||||
<RightSidebarIcon />
|
||||
</IconButton>
|
||||
|
||||
@@ -40,6 +40,7 @@ export const SidebarContainer = ({
|
||||
styles.sidebarBodyTarget,
|
||||
!BUILD_CONFIG.isElectron && styles.borderTop
|
||||
)}
|
||||
data-testid={`sidebar-tab-content-${sidebar.id}`}
|
||||
/>
|
||||
))
|
||||
) : (
|
||||
|
||||
@@ -22,6 +22,7 @@ export const SidebarHeaderSwitcher = () => {
|
||||
tabId={tab.id}
|
||||
/>
|
||||
),
|
||||
testId: `sidebar-tab-${tab.id}`,
|
||||
style: { padding: 0, fontSize: 20, width: 24 },
|
||||
}));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user