Skip to content

armgit / jan

Public Imported from GitHub
0

Jan is an open source alternative to ChatGPT that runs 100% offline on your computer.

fix: update tests

Louise92e41a64848
diff --git a/web-app/src/routes/settings/__tests__/interface.test.tsx b/web-app/src/routes/settings/__tests__/interface.test.tsx
index 3cc695b49..aff7fa714 100644
--- a/web-app/src/routes/settings/__tests__/interface.test.tsx
+++ b/web-app/src/routes/settings/__tests__/interface.test.tsx
@@ -61,12 +61,6 @@ vi.mock('@/containers/ChatWidthSwitcher', () => ({
ChatWidthSwitcher: () => <div data-testid="chat-width-switcher">Chat Width Switcher</div>,
}))
-vi.mock('@/containers/ThreadScrollBehaviorSwitcher', () => ({
- ThreadScrollBehaviorSwitcher: () => (
- <div data-testid="thread-scroll-switcher">Thread Scroll Switcher</div>
- ),
-}))
-
vi.mock('@/containers/CodeBlockStyleSwitcher', () => ({
default: () => <div data-testid="code-block-style-switcher">Code Block Style Switcher</div>,
}))
@@ -158,7 +152,6 @@ describe('Interface Settings Route', () => {
render(<Component />)
expect(screen.getByTestId('chat-width-switcher')).toBeInTheDocument()
- expect(screen.getByTestId('thread-scroll-switcher')).toBeInTheDocument()
})
it('should render code block controls', () => {
@@ -184,7 +177,7 @@ describe('Interface Settings Route', () => {
const resetButtons = screen.getAllByTestId('button')
expect(resetButtons.length).toBeGreaterThan(0)
-
+
// Check that buttons are clickable
resetButtons.forEach(button => {
expect(button).toBeInTheDocument()
@@ -197,7 +190,7 @@ describe('Interface Settings Route', () => {
const resetButtons = screen.getAllByTestId('button')
expect(resetButtons.length).toBeGreaterThan(0)
-
+
// Verify buttons can be clicked without errors
resetButtons.forEach(button => {
fireEvent.click(button)
@@ -211,7 +204,7 @@ describe('Interface Settings Route', () => {
const cardItems = screen.getAllByTestId('card-item')
expect(cardItems.length).toBeGreaterThan(0)
-
+
// Check that cards have proper structure
const cards = screen.getAllByTestId('card')
expect(cards.length).toBeGreaterThan(0)
@@ -222,13 +215,13 @@ describe('Interface Settings Route', () => {
render(<Component />)
const cardItems = screen.getAllByTestId('card-item')
-
+
// Check that some card items have responsive classes
- const responsiveItems = cardItems.filter(item =>
- item.className?.includes('flex-col') ||
+ const responsiveItems = cardItems.filter(item =>
+ item.className?.includes('flex-col') ||
item.className?.includes('sm:flex-row')
)
-
+
expect(responsiveItems.length).toBeGreaterThan(0)
})
@@ -238,7 +231,7 @@ describe('Interface Settings Route', () => {
const headerPage = screen.getByTestId('header-page')
expect(headerPage).toBeInTheDocument()
-
+
const settingsMenu = screen.getByTestId('settings-menu')
expect(settingsMenu).toBeInTheDocument()
})