forked from janhq/jan
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: small leftover issues with new starter screen (janhq#3661)
* fix: fix duplicate render progress component * fix: minor ui issue * chore: add manual recommend model * chore: make button create thread invisible * chore: fix conflict * chore: remove selector create thread icon * test: added unit test thread screen
- Loading branch information
Showing
7 changed files
with
109 additions
and
64 deletions.
There are no files selected for viewing
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
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,35 @@ | ||
import React from 'react' | ||
import { render, screen } from '@testing-library/react' | ||
import ThreadScreen from './index' | ||
import { useStarterScreen } from '../../hooks/useStarterScreen' | ||
import '@testing-library/jest-dom' | ||
|
||
global.ResizeObserver = class { | ||
observe() {} | ||
unobserve() {} | ||
disconnect() {} | ||
} | ||
// Mock the useStarterScreen hook | ||
jest.mock('@/hooks/useStarterScreen') | ||
|
||
describe('ThreadScreen', () => { | ||
it('renders OnDeviceStarterScreen when isShowStarterScreen is true', () => { | ||
;(useStarterScreen as jest.Mock).mockReturnValue({ | ||
isShowStarterScreen: true, | ||
extensionHasSettings: false, | ||
}) | ||
|
||
const { getByText } = render(<ThreadScreen />) | ||
expect(getByText('Select a model to start')).toBeInTheDocument() | ||
}) | ||
|
||
it('renders Thread panels when isShowStarterScreen is false', () => { | ||
;(useStarterScreen as jest.Mock).mockReturnValue({ | ||
isShowStarterScreen: false, | ||
extensionHasSettings: false, | ||
}) | ||
|
||
const { getByText } = render(<ThreadScreen />) | ||
expect(getByText('Welcome!')).toBeInTheDocument() | ||
}) | ||
}) |