-
-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed tests and updated welcome message style
- Loading branch information
Showing
11 changed files
with
84 additions
and
35 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
packages/css/themes/src/common/components/WelcomeMessage.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,15 @@ | ||
.nlux-comp-wlc_msg { | ||
display: flex; | ||
align-items: center; | ||
flex-direction: column; | ||
justify-content: center; | ||
width: 100%; | ||
height: 100%; | ||
padding: var(--nlux-padding); | ||
gap: var(--nlux-flex-gap); | ||
|
||
> .nlux-comp-wlc_msg_prs_nm { | ||
font-size: var(--nlux-font-size-l); | ||
font-weight: bold; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import {AiChat} from '@nlux-dev/react/src'; | ||
import {render} from '@testing-library/react'; | ||
import {afterEach, beforeEach, describe, expect, it} from 'vitest'; | ||
import {adapterBuilder} from '../../../../utils/adapterBuilder'; | ||
import {AdapterController} from '../../../../utils/adapters'; | ||
import {waitForRenderCycle} from '../../../../utils/wait'; | ||
|
||
describe('<AiChat /> + bot persona + welcome message', () => { | ||
let adapterController: AdapterController | undefined; | ||
|
||
beforeEach(() => { | ||
adapterController = adapterBuilder().withFetchText().create(); | ||
}); | ||
|
||
afterEach(() => { | ||
adapterController = undefined; | ||
}); | ||
|
||
describe('When bot persona is configured and a tagline is provided', () => { | ||
describe('When no initial conversation is provided', () => { | ||
it('The welcome message should be displayed', async () => { | ||
// Arrange | ||
const aiChat = ( | ||
<AiChat | ||
adapter={adapterController!.adapter} | ||
personaOptions={{ | ||
bot: { | ||
name: 'Bot', | ||
picture: 'https://example.com/bot.png', | ||
tagline: 'Welcome to the chat', | ||
}, | ||
}} | ||
/> | ||
); | ||
const {container} = render(aiChat); | ||
await waitForRenderCycle(); | ||
|
||
// Act | ||
const welcomeMessage = container.querySelector('.nlux-comp-wlc_msg')!; | ||
expect(welcomeMessage).not.toBeNull(); | ||
expect(welcomeMessage.textContent).toContain('Welcome to the chat'); | ||
}); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,15 @@ | ||
import v from 'vite'; | ||
/// <reference types="vitest" /> | ||
/// <reference types="vite/client" /> | ||
|
||
export default v.defineConfig({}); | ||
import react from '@vitejs/plugin-react'; | ||
import {defineConfig} from 'vite'; | ||
|
||
// https://vitejs.dev/config/ | ||
export default defineConfig({ | ||
plugins: [react()], | ||
test: { | ||
globals: true, | ||
environment: 'jsdom', | ||
setupFiles: ['./vitest.setup.ts'], | ||
}, | ||
}); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters