diff --git a/web/app/components/plugins/plugin-page/filter-management/__tests__/category-filter.spec.tsx b/web/app/components/plugins/plugin-page/filter-management/__tests__/category-filter.spec.tsx
index 051d16792a..e4b698a5f8 100644
--- a/web/app/components/plugins/plugin-page/filter-management/__tests__/category-filter.spec.tsx
+++ b/web/app/components/plugins/plugin-page/filter-management/__tests__/category-filter.spec.tsx
@@ -47,7 +47,7 @@ describe('CategoriesFilter', () => {
it('should show "allCategories" when no categories selected', () => {
render(
)
- expect(screen.getByText('plugin.allCategories')).toBeInTheDocument()
+ expect(screen.getByText('plugin.allCategories'))!.toBeInTheDocument()
})
it('should show selected category labels', () => {
@@ -60,7 +60,7 @@ describe('CategoriesFilter', () => {
it('should show +N when more than 2 selected', () => {
render(
)
- expect(screen.getByText('+1')).toBeInTheDocument()
+ expect(screen.getByText('+1'))!.toBeInTheDocument()
})
it('should clear all selections when clear button clicked', () => {
@@ -76,9 +76,9 @@ describe('CategoriesFilter', () => {
it('should render category options in dropdown', () => {
render(
)
- expect(screen.getByText('Tool')).toBeInTheDocument()
- expect(screen.getByText('Model')).toBeInTheDocument()
- expect(screen.getByText('Extension')).toBeInTheDocument()
+ expect(screen.getByText('Tool'))!.toBeInTheDocument()
+ expect(screen.getByText('Model'))!.toBeInTheDocument()
+ expect(screen.getByText('Extension'))!.toBeInTheDocument()
})
it('should toggle category on option click', () => {
@@ -94,7 +94,7 @@ describe('CategoriesFilter', () => {
render(
)
const toolElements = screen.getAllByText('Tool')
- fireEvent.click(toolElements[toolElements.length - 1])
+ fireEvent.click(toolElements[toolElements.length - 1]!)
expect(mockOnChange).toHaveBeenCalledWith([])
})
})
diff --git a/web/app/components/plugins/plugin-page/filter-management/__tests__/index.spec.tsx b/web/app/components/plugins/plugin-page/filter-management/__tests__/index.spec.tsx
index 95f0c5c120..f30b5fb5fa 100644
--- a/web/app/components/plugins/plugin-page/filter-management/__tests__/index.spec.tsx
+++ b/web/app/components/plugins/plugin-page/filter-management/__tests__/index.spec.tsx
@@ -338,7 +338,8 @@ describe('SearchBox Component', () => {
render(
)
// Assert
- expect(screen.getByPlaceholderText('plugin.search')).toBeInTheDocument()
+ // Assert
+ expect(screen.getByPlaceholderText('plugin.search'))!.toBeInTheDocument()
})
it('should render with provided searchQuery value', () => {
@@ -346,7 +347,8 @@ describe('SearchBox Component', () => {
render(
)
// Assert
- expect(screen.getByDisplayValue('test query')).toBeInTheDocument()
+ // Assert
+ expect(screen.getByDisplayValue('test query'))!.toBeInTheDocument()
})
it('should render search icon', () => {
@@ -355,7 +357,7 @@ describe('SearchBox Component', () => {
// Assert - Input should have showLeftIcon which renders search icon
const wrapper = container.querySelector('.w-\\[200px\\]')
- expect(wrapper).toBeInTheDocument()
+ expect(wrapper)!.toBeInTheDocument()
})
})
@@ -464,7 +466,8 @@ describe('CategoriesFilter Component', () => {
render(
)
// Assert
- expect(screen.getByText('plugin.allCategories')).toBeInTheDocument()
+ // Assert
+ expect(screen.getByText('plugin.allCategories'))!.toBeInTheDocument()
})
it('should render dropdown arrow when no selection', () => {
@@ -473,7 +476,7 @@ describe('CategoriesFilter Component', () => {
// Assert - Arrow icon should be visible
const arrowIcon = container.querySelector('svg')
- expect(arrowIcon).toBeInTheDocument()
+ expect(arrowIcon)!.toBeInTheDocument()
})
it('should render selected category labels', () => {
@@ -481,7 +484,8 @@ describe('CategoriesFilter Component', () => {
render(
)
// Assert
- expect(screen.getByText('Models')).toBeInTheDocument()
+ // Assert
+ expect(screen.getByText('Models'))!.toBeInTheDocument()
})
it('should show clear button when categories are selected', () => {
@@ -490,7 +494,7 @@ describe('CategoriesFilter Component', () => {
// Assert - Close icon should be visible
const closeIcon = container.querySelector('[class*="cursor-pointer"]')
- expect(closeIcon).toBeInTheDocument()
+ expect(closeIcon)!.toBeInTheDocument()
})
it('should show count badge for more than 2 selections', () => {
@@ -498,7 +502,8 @@ describe('CategoriesFilter Component', () => {
render(
)
// Assert
- expect(screen.getByText('+1')).toBeInTheDocument()
+ // Assert
+ expect(screen.getByText('+1'))!.toBeInTheDocument()
})
})
@@ -512,7 +517,7 @@ describe('CategoriesFilter Component', () => {
// Assert
await waitFor(() => {
- expect(screen.getByTestId('portal-content')).toBeInTheDocument()
+ expect(screen.getByTestId('portal-content'))!.toBeInTheDocument()
})
})
@@ -525,10 +530,10 @@ describe('CategoriesFilter Component', () => {
// Assert
await waitFor(() => {
- expect(screen.getByText('Models')).toBeInTheDocument()
- expect(screen.getByText('Tools')).toBeInTheDocument()
- expect(screen.getByText('Extensions')).toBeInTheDocument()
- expect(screen.getByText('Agents')).toBeInTheDocument()
+ expect(screen.getByText('Models'))!.toBeInTheDocument()
+ expect(screen.getByText('Tools'))!.toBeInTheDocument()
+ expect(screen.getByText('Extensions'))!.toBeInTheDocument()
+ expect(screen.getByText('Agents'))!.toBeInTheDocument()
})
})
@@ -541,7 +546,7 @@ describe('CategoriesFilter Component', () => {
// Assert
await waitFor(() => {
- expect(screen.getByPlaceholderText('plugin.searchCategories')).toBeInTheDocument()
+ expect(screen.getByPlaceholderText('plugin.searchCategories'))!.toBeInTheDocument()
})
})
})
@@ -555,7 +560,7 @@ describe('CategoriesFilter Component', () => {
// Act - Open dropdown and click category
fireEvent.click(screen.getByTestId('portal-trigger'))
await waitFor(() => {
- expect(screen.getByText('Models')).toBeInTheDocument()
+ expect(screen.getByText('Models'))!.toBeInTheDocument()
})
fireEvent.click(screen.getByText('Models'))
@@ -592,7 +597,7 @@ describe('CategoriesFilter Component', () => {
// Act
fireEvent.click(screen.getByTestId('portal-trigger'))
await waitFor(() => {
- expect(screen.getByText('Tools')).toBeInTheDocument()
+ expect(screen.getByText('Tools'))!.toBeInTheDocument()
})
fireEvent.click(screen.getByText('Tools'))
@@ -607,7 +612,7 @@ describe('CategoriesFilter Component', () => {
// Act - Find and click the close icon
const closeIcon = container.querySelector('.text-text-quaternary')
- expect(closeIcon).toBeInTheDocument()
+ expect(closeIcon)!.toBeInTheDocument()
fireEvent.click(closeIcon!)
// Assert
@@ -623,14 +628,15 @@ describe('CategoriesFilter Component', () => {
// Act
fireEvent.click(screen.getByTestId('portal-trigger'))
await waitFor(() => {
- expect(screen.getByPlaceholderText('plugin.searchCategories')).toBeInTheDocument()
+ expect(screen.getByPlaceholderText('plugin.searchCategories'))!.toBeInTheDocument()
})
fireEvent.change(screen.getByPlaceholderText('plugin.searchCategories'), {
target: { value: 'mod' },
})
// Assert
- expect(screen.getByText('Models')).toBeInTheDocument()
+ // Assert
+ expect(screen.getByText('Models'))!.toBeInTheDocument()
expect(screen.queryByText('Extensions')).not.toBeInTheDocument()
})
@@ -641,14 +647,15 @@ describe('CategoriesFilter Component', () => {
// Act
fireEvent.click(screen.getByTestId('portal-trigger'))
await waitFor(() => {
- expect(screen.getByPlaceholderText('plugin.searchCategories')).toBeInTheDocument()
+ expect(screen.getByPlaceholderText('plugin.searchCategories'))!.toBeInTheDocument()
})
fireEvent.change(screen.getByPlaceholderText('plugin.searchCategories'), {
target: { value: 'MOD' },
})
// Assert
- expect(screen.getByText('Models')).toBeInTheDocument()
+ // Assert
+ expect(screen.getByText('Models'))!.toBeInTheDocument()
})
})
@@ -696,7 +703,8 @@ describe('TagFilter Component', () => {
render(
)
// Assert
- expect(screen.getByText('pluginTags.allTags')).toBeInTheDocument()
+ // Assert
+ expect(screen.getByText('pluginTags.allTags'))!.toBeInTheDocument()
})
it('should render selected tag labels', () => {
@@ -704,7 +712,8 @@ describe('TagFilter Component', () => {
render(
)
// Assert
- expect(screen.getByText('Agent')).toBeInTheDocument()
+ // Assert
+ expect(screen.getByText('Agent'))!.toBeInTheDocument()
})
it('should show count badge for more than 2 selections', () => {
@@ -712,7 +721,8 @@ describe('TagFilter Component', () => {
render(
)
// Assert
- expect(screen.getByText('+1')).toBeInTheDocument()
+ // Assert
+ expect(screen.getByText('+1'))!.toBeInTheDocument()
})
it('should show clear button when tags are selected', () => {
@@ -721,7 +731,7 @@ describe('TagFilter Component', () => {
// Assert
const closeIcon = container.querySelector('.text-text-quaternary')
- expect(closeIcon).toBeInTheDocument()
+ expect(closeIcon)!.toBeInTheDocument()
})
})
@@ -735,7 +745,7 @@ describe('TagFilter Component', () => {
// Assert
await waitFor(() => {
- expect(screen.getByTestId('portal-content')).toBeInTheDocument()
+ expect(screen.getByTestId('portal-content'))!.toBeInTheDocument()
})
})
@@ -748,10 +758,10 @@ describe('TagFilter Component', () => {
// Assert
await waitFor(() => {
- expect(screen.getByText('Agent')).toBeInTheDocument()
- expect(screen.getByText('RAG')).toBeInTheDocument()
- expect(screen.getByText('Search')).toBeInTheDocument()
- expect(screen.getByText('Image')).toBeInTheDocument()
+ expect(screen.getByText('Agent'))!.toBeInTheDocument()
+ expect(screen.getByText('RAG'))!.toBeInTheDocument()
+ expect(screen.getByText('Search'))!.toBeInTheDocument()
+ expect(screen.getByText('Image'))!.toBeInTheDocument()
})
})
})
@@ -765,7 +775,7 @@ describe('TagFilter Component', () => {
// Act
fireEvent.click(screen.getByTestId('portal-trigger'))
await waitFor(() => {
- expect(screen.getByText('Agent')).toBeInTheDocument()
+ expect(screen.getByText('Agent'))!.toBeInTheDocument()
})
fireEvent.click(screen.getByText('Agent'))
@@ -783,7 +793,7 @@ describe('TagFilter Component', () => {
await waitFor(() => {
// Find the Agent option in dropdown
const agentOptions = screen.getAllByText('Agent')
- fireEvent.click(agentOptions[agentOptions.length - 1])
+ fireEvent.click(agentOptions[agentOptions.length - 1]!)
})
// Assert
@@ -798,7 +808,7 @@ describe('TagFilter Component', () => {
// Act
fireEvent.click(screen.getByTestId('portal-trigger'))
await waitFor(() => {
- expect(screen.getByText('RAG')).toBeInTheDocument()
+ expect(screen.getByText('RAG'))!.toBeInTheDocument()
})
fireEvent.click(screen.getByText('RAG'))
@@ -828,14 +838,15 @@ describe('TagFilter Component', () => {
// Act
fireEvent.click(screen.getByTestId('portal-trigger'))
await waitFor(() => {
- expect(screen.getByPlaceholderText('pluginTags.searchTags')).toBeInTheDocument()
+ expect(screen.getByPlaceholderText('pluginTags.searchTags'))!.toBeInTheDocument()
})
fireEvent.change(screen.getByPlaceholderText('pluginTags.searchTags'), {
target: { value: 'rag' },
})
// Assert
- expect(screen.getByText('RAG')).toBeInTheDocument()
+ // Assert
+ expect(screen.getByText('RAG'))!.toBeInTheDocument()
expect(screen.queryByText('Image')).not.toBeInTheDocument()
})
})
@@ -855,9 +866,10 @@ describe('FilterManagement Component', () => {
renderFilterManagement()
// Assert - All three filters should be present
- expect(screen.getByText('plugin.allCategories')).toBeInTheDocument()
- expect(screen.getByText('pluginTags.allTags')).toBeInTheDocument()
- expect(screen.getByPlaceholderText('plugin.search')).toBeInTheDocument()
+ // Assert - All three filters should be present
+ expect(screen.getByText('plugin.allCategories'))!.toBeInTheDocument()
+ expect(screen.getByText('pluginTags.allTags'))!.toBeInTheDocument()
+ expect(screen.getByPlaceholderText('plugin.search'))!.toBeInTheDocument()
})
it('should render with correct container classes', () => {
@@ -866,7 +878,7 @@ describe('FilterManagement Component', () => {
// Assert
const wrapper = container.firstChild as HTMLElement
- expect(wrapper).toHaveClass('flex', 'items-center', 'gap-2', 'self-stretch')
+ expect(wrapper)!.toHaveClass('flex', 'items-center', 'gap-2', 'self-stretch')
})
})
@@ -879,9 +891,10 @@ describe('FilterManagement Component', () => {
renderFilterManagement()
// Assert
- expect(screen.getByText('plugin.allCategories')).toBeInTheDocument()
- expect(screen.getByText('pluginTags.allTags')).toBeInTheDocument()
- expect(screen.getByPlaceholderText('plugin.search')).toHaveValue('')
+ // Assert
+ expect(screen.getByText('plugin.allCategories'))!.toBeInTheDocument()
+ expect(screen.getByText('pluginTags.allTags'))!.toBeInTheDocument()
+ expect(screen.getByPlaceholderText('plugin.search'))!.toHaveValue('')
})
it('should initialize with pre-selected categories', () => {
@@ -892,7 +905,8 @@ describe('FilterManagement Component', () => {
renderFilterManagement()
// Assert
- expect(screen.getByText('Models')).toBeInTheDocument()
+ // Assert
+ expect(screen.getByText('Models'))!.toBeInTheDocument()
})
it('should initialize with pre-selected tags', () => {
@@ -903,7 +917,8 @@ describe('FilterManagement Component', () => {
renderFilterManagement()
// Assert
- expect(screen.getByText('Agent')).toBeInTheDocument()
+ // Assert
+ expect(screen.getByText('Agent'))!.toBeInTheDocument()
})
it('should initialize with search query', () => {
@@ -914,7 +929,8 @@ describe('FilterManagement Component', () => {
renderFilterManagement()
// Assert
- expect(screen.getByDisplayValue('initial search')).toBeInTheDocument()
+ // Assert
+ expect(screen.getByDisplayValue('initial search'))!.toBeInTheDocument()
})
})
@@ -926,10 +942,10 @@ describe('FilterManagement Component', () => {
// Act - Open categories dropdown and select
const triggers = screen.getAllByTestId('portal-trigger')
- fireEvent.click(triggers[0]) // Categories filter trigger
+ fireEvent.click(triggers[0]!) // Categories filter trigger
await waitFor(() => {
- expect(screen.getByText('Models')).toBeInTheDocument()
+ expect(screen.getByText('Models'))!.toBeInTheDocument()
})
fireEvent.click(screen.getByText('Models'))
@@ -948,10 +964,10 @@ describe('FilterManagement Component', () => {
// Act - Open tags dropdown and select
const triggers = screen.getAllByTestId('portal-trigger')
- fireEvent.click(triggers[1]) // Tags filter trigger
+ fireEvent.click(triggers[1]!) // Tags filter trigger
await waitFor(() => {
- expect(screen.getByText('Agent')).toBeInTheDocument()
+ expect(screen.getByText('Agent'))!.toBeInTheDocument()
})
fireEvent.click(screen.getByText('Agent'))
@@ -990,9 +1006,9 @@ describe('FilterManagement Component', () => {
// Act 1 - Select a category
const triggers = screen.getAllByTestId('portal-trigger')
- fireEvent.click(triggers[0])
+ fireEvent.click(triggers[0]!)
await waitFor(() => {
- expect(screen.getByText('Models')).toBeInTheDocument()
+ expect(screen.getByText('Models'))!.toBeInTheDocument()
})
fireEvent.click(screen.getByText('Models'))
@@ -1003,12 +1019,12 @@ describe('FilterManagement Component', () => {
})
// Close dropdown by clicking trigger again
- fireEvent.click(triggers[0])
+ fireEvent.click(triggers[0]!)
// Act 2 - Select a tag (state should include previous category)
- fireEvent.click(triggers[1])
+ fireEvent.click(triggers[1]!)
await waitFor(() => {
- expect(screen.getByText('Agent')).toBeInTheDocument()
+ expect(screen.getByText('Agent'))!.toBeInTheDocument()
})
fireEvent.click(screen.getByText('Agent'))
@@ -1051,20 +1067,20 @@ describe('FilterManagement Component', () => {
// Act 1 - Select categories
const triggers = screen.getAllByTestId('portal-trigger')
- fireEvent.click(triggers[0])
+ fireEvent.click(triggers[0]!)
await waitFor(() => {
- expect(screen.getByText('Models')).toBeInTheDocument()
+ expect(screen.getByText('Models'))!.toBeInTheDocument()
})
fireEvent.click(screen.getByText('Models'))
- fireEvent.click(triggers[0]) // Close
+ fireEvent.click(triggers[0]!) // Close
// Act 2 - Select tags
- fireEvent.click(triggers[1])
+ fireEvent.click(triggers[1]!)
await waitFor(() => {
- expect(screen.getByText('RAG')).toBeInTheDocument()
+ expect(screen.getByText('RAG'))!.toBeInTheDocument()
})
fireEvent.click(screen.getByText('RAG'))
- fireEvent.click(triggers[1]) // Close
+ fireEvent.click(triggers[1]!) // Close
// Act 3 - Enter search
fireEvent.change(screen.getByPlaceholderText('plugin.search'), {
@@ -1103,7 +1119,7 @@ describe('FilterManagement Component', () => {
// Act - Clear categories (click clear button)
const closeIcons = container.querySelectorAll('.text-text-quaternary')
- fireEvent.click(closeIcons[0]) // First close icon is for categories
+ fireEvent.click(closeIcons[0]!) // First close icon is for categories
// Assert
expect(onFilterChange).toHaveBeenLastCalledWith({
@@ -1124,7 +1140,8 @@ describe('FilterManagement Component', () => {
render(
)
// Assert - Should render without errors
- expect(screen.getByText('plugin.allCategories')).toBeInTheDocument()
+ // Assert - Should render without errors
+ expect(screen.getByText('plugin.allCategories'))!.toBeInTheDocument()
})
it('should handle multiple rapid filter changes', () => {
diff --git a/web/app/components/plugins/plugin-page/filter-management/category-filter.tsx b/web/app/components/plugins/plugin-page/filter-management/category-filter.tsx
index f6ace774e8..8dbef5395d 100644
--- a/web/app/components/plugins/plugin-page/filter-management/category-filter.tsx
+++ b/web/app/components/plugins/plugin-page/filter-management/category-filter.tsx
@@ -61,7 +61,7 @@ const CategoriesFilter = ({
!selectedTagsLength && t('allCategories', { ns: 'plugin' })
}
{
- !!selectedTagsLength && value.map(val => categoriesMap[val].label).slice(0, 2).join(',')
+ !!selectedTagsLength && value.map(val => categoriesMap[val]!.label).slice(0, 2).join(',')
}
{
selectedTagsLength > 2 && (
diff --git a/web/app/components/plugins/plugin-page/list/__tests__/index.spec.tsx b/web/app/components/plugins/plugin-page/list/__tests__/index.spec.tsx
index c6326461d4..6537237839 100644
--- a/web/app/components/plugins/plugin-page/list/__tests__/index.spec.tsx
+++ b/web/app/components/plugins/plugin-page/list/__tests__/index.spec.tsx
@@ -113,7 +113,8 @@ describe('PluginList', () => {
const { container } = render(
)
// Assert
- expect(container).toBeInTheDocument()
+ // Assert
+ expect(container)!.toBeInTheDocument()
})
it('should render container with correct structure', () => {
@@ -125,10 +126,10 @@ describe('PluginList', () => {
// Assert
const outerDiv = container.firstChild as HTMLElement
- expect(outerDiv).toHaveClass('pb-3')
+ expect(outerDiv)!.toHaveClass('pb-3')
const gridDiv = outerDiv.firstChild as HTMLElement
- expect(gridDiv).toHaveClass('grid', 'grid-cols-2', 'gap-3')
+ expect(gridDiv)!.toHaveClass('grid', 'grid-cols-2', 'gap-3')
})
it('should render single plugin correctly', () => {
@@ -141,7 +142,7 @@ describe('PluginList', () => {
// Assert
const pluginItems = screen.getAllByTestId('plugin-item')
expect(pluginItems).toHaveLength(1)
- expect(pluginItems[0]).toHaveAttribute('data-plugin-name', 'single-plugin')
+ expect(pluginItems[0])!.toHaveAttribute('data-plugin-name', 'single-plugin')
})
it('should render multiple plugins correctly', () => {
@@ -169,9 +170,9 @@ describe('PluginList', () => {
// Assert
const pluginItems = screen.getAllByTestId('plugin-item')
- expect(pluginItems[0]).toHaveAttribute('data-plugin-id', 'first')
- expect(pluginItems[1]).toHaveAttribute('data-plugin-id', 'second')
- expect(pluginItems[2]).toHaveAttribute('data-plugin-id', 'third')
+ expect(pluginItems[0])!.toHaveAttribute('data-plugin-id', 'first')
+ expect(pluginItems[1])!.toHaveAttribute('data-plugin-id', 'second')
+ expect(pluginItems[2])!.toHaveAttribute('data-plugin-id', 'third')
})
it('should pass plugin prop to each PluginItem', () => {
@@ -185,8 +186,9 @@ describe('PluginList', () => {
render(
)
// Assert
- expect(screen.getByText('Plugin A')).toBeInTheDocument()
- expect(screen.getByText('Plugin B')).toBeInTheDocument()
+ // Assert
+ expect(screen.getByText('Plugin A'))!.toBeInTheDocument()
+ expect(screen.getByText('Plugin B'))!.toBeInTheDocument()
})
})
@@ -198,7 +200,7 @@ describe('PluginList', () => {
// Assert
const gridDiv = container.querySelector('.grid')
- expect(gridDiv).toBeEmptyDOMElement()
+ expect(gridDiv)!.toBeEmptyDOMElement()
})
it('should handle pluginList with various categories', () => {
@@ -250,6 +252,37 @@ describe('PluginList', () => {
// Arrange & Act
render(
)
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
// Assert
expect(screen.queryByTestId('plugin-item')).not.toBeInTheDocument()
})
@@ -303,7 +336,8 @@ describe('PluginList', () => {
render(
)
// Assert
- expect(screen.getByTestId('plugin-item')).toBeInTheDocument()
+ // Assert
+ expect(screen.getByTestId('plugin-item'))!.toBeInTheDocument()
})
it('should handle plugin with minimal data', () => {
@@ -317,7 +351,8 @@ describe('PluginList', () => {
render(
)
// Assert
- expect(screen.getByTestId('plugin-item')).toBeInTheDocument()
+ // Assert
+ expect(screen.getByTestId('plugin-item'))!.toBeInTheDocument()
})
it('should handle plugins with undefined optional fields', () => {
@@ -333,7 +368,8 @@ describe('PluginList', () => {
render(
)
// Assert
- expect(screen.getByTestId('plugin-item')).toBeInTheDocument()
+ // Assert
+ expect(screen.getByTestId('plugin-item'))!.toBeInTheDocument()
})
})
@@ -348,7 +384,7 @@ describe('PluginList', () => {
// Assert
const gridDiv = container.querySelector('.grid')
- expect(gridDiv).toHaveClass('grid-cols-2')
+ expect(gridDiv)!.toHaveClass('grid-cols-2')
})
it('should have proper gap between items', () => {
@@ -360,7 +396,7 @@ describe('PluginList', () => {
// Assert
const gridDiv = container.querySelector('.grid')
- expect(gridDiv).toHaveClass('gap-3')
+ expect(gridDiv)!.toHaveClass('gap-3')
})
it('should have bottom padding on container', () => {
@@ -372,7 +408,7 @@ describe('PluginList', () => {
// Assert
const outerDiv = container.firstChild as HTMLElement
- expect(outerDiv).toHaveClass('pb-3')
+ expect(outerDiv)!.toHaveClass('pb-3')
})
})
@@ -404,6 +440,37 @@ describe('PluginList', () => {
rerender(
)
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
// Assert
expect(screen.queryByTestId('plugin-item')).not.toBeInTheDocument()
})
@@ -430,12 +497,13 @@ describe('PluginList', () => {
// Act
const { rerender } = render(
)
- expect(screen.getByText('Original Name')).toBeInTheDocument()
+ expect(screen.getByText('Original Name'))!.toBeInTheDocument()
rerender(
)
// Assert
- expect(screen.getByText('Updated Name')).toBeInTheDocument()
+ // Assert
+ expect(screen.getByText('Updated Name'))!.toBeInTheDocument()
expect(screen.queryByText('Original Name')).not.toBeInTheDocument()
})
})
@@ -454,15 +522,15 @@ describe('PluginList', () => {
const { rerender } = render(
)
// Reorder the list
- const reorderedList = [pluginList[2], pluginList[0], pluginList[1]]
+ const reorderedList = [pluginList[2]!, pluginList[0]!, pluginList[1]!]
rerender(
)
// Assert - All items should still be present
const items = screen.getAllByTestId('plugin-item')
expect(items).toHaveLength(3)
- expect(items[0]).toHaveAttribute('data-plugin-id', 'stable-key-3')
- expect(items[1]).toHaveAttribute('data-plugin-id', 'stable-key-1')
- expect(items[2]).toHaveAttribute('data-plugin-id', 'stable-key-2')
+ expect(items[0])!.toHaveAttribute('data-plugin-id', 'stable-key-3')
+ expect(items[1])!.toHaveAttribute('data-plugin-id', 'stable-key-1')
+ expect(items[2])!.toHaveAttribute('data-plugin-id', 'stable-key-2')
})
})
@@ -476,7 +544,8 @@ describe('PluginList', () => {
render(
)
// Assert
- expect(screen.getByTestId('plugin-item')).toBeInTheDocument()
+ // Assert
+ expect(screen.getByTestId('plugin-item'))!.toBeInTheDocument()
})
it('should render deleted/deprecated plugins', () => {
@@ -492,7 +561,8 @@ describe('PluginList', () => {
render(
)
// Assert
- expect(screen.getByTestId('plugin-item')).toBeInTheDocument()
+ // Assert
+ expect(screen.getByTestId('plugin-item'))!.toBeInTheDocument()
})
it('should render mixed status plugins', () => {
@@ -529,7 +599,8 @@ describe('PluginList', () => {
render(
)
// Assert
- expect(screen.getByTestId('plugin-item')).toBeInTheDocument()
+ // Assert
+ expect(screen.getByTestId('plugin-item'))!.toBeInTheDocument()
})
it('should render plugins with outdated version', () => {
@@ -545,7 +616,8 @@ describe('PluginList', () => {
render(
)
// Assert
- expect(screen.getByTestId('plugin-item')).toBeInTheDocument()
+ // Assert
+ expect(screen.getByTestId('plugin-item'))!.toBeInTheDocument()
})
})
@@ -607,9 +679,10 @@ describe('PluginList', () => {
render(
)
// Assert
- expect(screen.getByText('Marketplace Plugin')).toBeInTheDocument()
- expect(screen.getByText('GitHub Plugin')).toBeInTheDocument()
- expect(screen.getByText('Local Plugin')).toBeInTheDocument()
+ // Assert
+ expect(screen.getByText('Marketplace Plugin'))!.toBeInTheDocument()
+ expect(screen.getByText('GitHub Plugin'))!.toBeInTheDocument()
+ expect(screen.getByText('Local Plugin'))!.toBeInTheDocument()
})
it('should render plugins of different categories together', () => {
@@ -636,9 +709,10 @@ describe('PluginList', () => {
render(
)
// Assert
- expect(screen.getByText('Tool Plugin')).toBeInTheDocument()
- expect(screen.getByText('Model Plugin')).toBeInTheDocument()
- expect(screen.getByText('Agent Plugin')).toBeInTheDocument()
+ // Assert
+ expect(screen.getByText('Tool Plugin'))!.toBeInTheDocument()
+ expect(screen.getByText('Model Plugin'))!.toBeInTheDocument()
+ expect(screen.getByText('Agent Plugin'))!.toBeInTheDocument()
})
})
diff --git a/web/app/components/plugins/plugin-page/plugin-tasks/__tests__/index.spec.tsx b/web/app/components/plugins/plugin-page/plugin-tasks/__tests__/index.spec.tsx
index 56992b377f..15b4429de8 100644
--- a/web/app/components/plugins/plugin-page/plugin-tasks/__tests__/index.spec.tsx
+++ b/web/app/components/plugins/plugin-page/plugin-tasks/__tests__/index.spec.tsx
@@ -83,8 +83,8 @@ describe('usePluginTaskStatus Hook', () => {
render(
)
- expect(screen.getByTestId('running-count')).toHaveTextContent('1')
- expect(screen.getByTestId('running-id')).toHaveTextContent(runningPlugin.plugin_unique_identifier)
+ expect(screen.getByTestId('running-count'))!.toHaveTextContent('1')
+ expect(screen.getByTestId('running-id'))!.toHaveTextContent(runningPlugin.plugin_unique_identifier)
})
it('should categorize success plugins correctly', () => {
@@ -103,8 +103,8 @@ describe('usePluginTaskStatus Hook', () => {
render(
)
- expect(screen.getByTestId('success-count')).toHaveTextContent('1')
- expect(screen.getByTestId('success-id')).toHaveTextContent(successPlugin.plugin_unique_identifier)
+ expect(screen.getByTestId('success-count'))!.toHaveTextContent('1')
+ expect(screen.getByTestId('success-id'))!.toHaveTextContent(successPlugin.plugin_unique_identifier)
})
it('should categorize error plugins correctly', () => {
@@ -123,8 +123,8 @@ describe('usePluginTaskStatus Hook', () => {
render(
)
- expect(screen.getByTestId('error-count')).toHaveTextContent('1')
- expect(screen.getByTestId('error-id')).toHaveTextContent(errorPlugin.plugin_unique_identifier)
+ expect(screen.getByTestId('error-count'))!.toHaveTextContent('1')
+ expect(screen.getByTestId('error-id'))!.toHaveTextContent(errorPlugin.plugin_unique_identifier)
})
it('should categorize mixed plugins correctly', () => {
@@ -149,10 +149,10 @@ describe('usePluginTaskStatus Hook', () => {
render(
)
- expect(screen.getByTestId('running')).toHaveTextContent('1')
- expect(screen.getByTestId('success')).toHaveTextContent('1')
- expect(screen.getByTestId('error')).toHaveTextContent('1')
- expect(screen.getByTestId('total')).toHaveTextContent('3')
+ expect(screen.getByTestId('running'))!.toHaveTextContent('1')
+ expect(screen.getByTestId('success'))!.toHaveTextContent('1')
+ expect(screen.getByTestId('error'))!.toHaveTextContent('1')
+ expect(screen.getByTestId('total'))!.toHaveTextContent('3')
})
})
@@ -175,11 +175,11 @@ describe('usePluginTaskStatus Hook', () => {
render(
)
- expect(screen.getByTestId('isInstalling')).toHaveTextContent('true')
- expect(screen.getByTestId('isInstallingWithSuccess')).toHaveTextContent('false')
- expect(screen.getByTestId('isInstallingWithError')).toHaveTextContent('false')
- expect(screen.getByTestId('isSuccess')).toHaveTextContent('false')
- expect(screen.getByTestId('isFailed')).toHaveTextContent('false')
+ expect(screen.getByTestId('isInstalling'))!.toHaveTextContent('true')
+ expect(screen.getByTestId('isInstallingWithSuccess'))!.toHaveTextContent('false')
+ expect(screen.getByTestId('isInstallingWithError'))!.toHaveTextContent('false')
+ expect(screen.getByTestId('isSuccess'))!.toHaveTextContent('false')
+ expect(screen.getByTestId('isFailed'))!.toHaveTextContent('false')
})
it('should set isInstallingWithSuccess when running and success plugins exist', () => {
@@ -194,7 +194,7 @@ describe('usePluginTaskStatus Hook', () => {
}
render(
)
- expect(screen.getByTestId('flag')).toHaveTextContent('true')
+ expect(screen.getByTestId('flag'))!.toHaveTextContent('true')
})
it('should set isInstallingWithError when running and error plugins exist', () => {
@@ -209,7 +209,7 @@ describe('usePluginTaskStatus Hook', () => {
}
render(
)
- expect(screen.getByTestId('flag')).toHaveTextContent('true')
+ expect(screen.getByTestId('flag'))!.toHaveTextContent('true')
})
it('should set isSuccess when all plugins succeeded', () => {
@@ -224,7 +224,7 @@ describe('usePluginTaskStatus Hook', () => {
}
render(
)
- expect(screen.getByTestId('flag')).toHaveTextContent('true')
+ expect(screen.getByTestId('flag'))!.toHaveTextContent('true')
})
it('should set isFailed when no running plugins and some failed', () => {
@@ -239,7 +239,7 @@ describe('usePluginTaskStatus Hook', () => {
}
render(
)
- expect(screen.getByTestId('flag')).toHaveTextContent('true')
+ expect(screen.getByTestId('flag'))!.toHaveTextContent('true')
})
})
@@ -296,12 +296,12 @@ describe('TaskStatusIndicator Component', () => {
describe('Rendering', () => {
it('should render without crashing', () => {
render(
)
- expect(document.getElementById('plugin-task-trigger')).toBeInTheDocument()
+ expect(document.getElementById('plugin-task-trigger'))!.toBeInTheDocument()
})
it('should render with correct id', () => {
render(
)
- expect(document.getElementById('plugin-task-trigger')).toBeInTheDocument()
+ expect(document.getElementById('plugin-task-trigger'))!.toBeInTheDocument()
})
})
@@ -309,17 +309,18 @@ describe('TaskStatusIndicator Component', () => {
it('should show downloading icon when installing', () => {
render(
)
// DownloadingIcon is rendered when isInstalling is true
- expect(document.getElementById('plugin-task-trigger')).toBeInTheDocument()
+ // DownloadingIcon is rendered when isInstalling is true
+ expect(document.getElementById('plugin-task-trigger'))!.toBeInTheDocument()
})
it('should show downloading icon when installing with error', () => {
render(
)
- expect(document.getElementById('plugin-task-trigger')).toBeInTheDocument()
+ expect(document.getElementById('plugin-task-trigger'))!.toBeInTheDocument()
})
it('should show install icon when not installing', () => {
render(
)
- expect(document.getElementById('plugin-task-trigger')).toBeInTheDocument()
+ expect(document.getElementById('plugin-task-trigger'))!.toBeInTheDocument()
})
})
@@ -333,7 +334,7 @@ describe('TaskStatusIndicator Component', () => {
totalPluginsLength={3}
/>,
)
- expect(document.getElementById('plugin-task-trigger')).toBeInTheDocument()
+ expect(document.getElementById('plugin-task-trigger'))!.toBeInTheDocument()
})
it('should show progress circle when installing with success', () => {
@@ -345,7 +346,7 @@ describe('TaskStatusIndicator Component', () => {
totalPluginsLength={3}
/>,
)
- expect(document.getElementById('plugin-task-trigger')).toBeInTheDocument()
+ expect(document.getElementById('plugin-task-trigger'))!.toBeInTheDocument()
})
it('should show error progress circle when installing with error', () => {
@@ -357,7 +358,7 @@ describe('TaskStatusIndicator Component', () => {
totalPluginsLength={3}
/>,
)
- expect(document.getElementById('plugin-task-trigger')).toBeInTheDocument()
+ expect(document.getElementById('plugin-task-trigger'))!.toBeInTheDocument()
})
it('should show success icon when all completed successfully', () => {
@@ -370,12 +371,12 @@ describe('TaskStatusIndicator Component', () => {
totalPluginsLength={3}
/>,
)
- expect(document.getElementById('plugin-task-trigger')).toBeInTheDocument()
+ expect(document.getElementById('plugin-task-trigger'))!.toBeInTheDocument()
})
it('should show error icon when failed', () => {
render(
)
- expect(document.getElementById('plugin-task-trigger')).toBeInTheDocument()
+ expect(document.getElementById('plugin-task-trigger'))!.toBeInTheDocument()
})
})
@@ -383,19 +384,19 @@ describe('TaskStatusIndicator Component', () => {
it('should apply error styles when installing with error', () => {
render(
)
const trigger = document.getElementById('plugin-task-trigger')
- expect(trigger).toHaveClass('bg-state-destructive-hover')
+ expect(trigger)!.toHaveClass('bg-state-destructive-hover')
})
it('should apply error styles when failed', () => {
render(
)
const trigger = document.getElementById('plugin-task-trigger')
- expect(trigger).toHaveClass('bg-state-destructive-hover')
+ expect(trigger)!.toHaveClass('bg-state-destructive-hover')
})
it('should apply cursor-pointer when clickable', () => {
render(
)
const trigger = document.getElementById('plugin-task-trigger')
- expect(trigger).toHaveClass('cursor-pointer')
+ expect(trigger)!.toHaveClass('cursor-pointer')
})
})
@@ -429,7 +430,7 @@ describe('PluginTaskList Component', () => {
describe('Rendering', () => {
it('should render without crashing with empty lists', () => {
render(
)
- expect(document.querySelector('.w-\\[360px\\]')).toBeInTheDocument()
+ expect(document.querySelector('.w-\\[360px\\]'))!.toBeInTheDocument()
})
it('should render running plugins section when plugins exist', () => {
@@ -439,7 +440,8 @@ describe('PluginTaskList Component', () => {
// Translation key is returned as text in tests, multiple matches expected (title + status)
expect(screen.getAllByText(/task\.installing/i).length).toBeGreaterThan(0)
// Verify section container is rendered
- expect(document.querySelector('.max-h-\\[300px\\]')).toBeInTheDocument()
+ // Verify section container is rendered
+ expect(document.querySelector('.max-h-\\[300px\\]'))!.toBeInTheDocument()
})
it('should render success plugins section when plugins exist', () => {
@@ -454,7 +456,7 @@ describe('PluginTaskList Component', () => {
const errorPlugins = [createMockPlugin({ status: TaskStatus.failed, message: 'Error occurred' })]
render(
)
- expect(screen.getByText('Error occurred')).toBeInTheDocument()
+ expect(screen.getByText('Error occurred'))!.toBeInTheDocument()
})
it('should render all sections when all types exist', () => {
@@ -541,7 +543,7 @@ describe('PluginTaskList Component', () => {
render(
)
- expect(screen.getByText('My Test Plugin')).toBeInTheDocument()
+ expect(screen.getByText('My Test Plugin'))!.toBeInTheDocument()
})
it('should display plugin message when available', () => {
@@ -552,7 +554,7 @@ describe('PluginTaskList Component', () => {
render(
)
- expect(screen.getByText('Successfully installed!')).toBeInTheDocument()
+ expect(screen.getByText('Successfully installed!'))!.toBeInTheDocument()
})
it('should display multiple plugins in each section', () => {
@@ -563,8 +565,8 @@ describe('PluginTaskList Component', () => {
render(
)
- expect(screen.getByText('Plugin A')).toBeInTheDocument()
- expect(screen.getByText('Plugin B')).toBeInTheDocument()
+ expect(screen.getByText('Plugin A'))!.toBeInTheDocument()
+ expect(screen.getByText('Plugin B'))!.toBeInTheDocument()
// Count is rendered, verify multiple items are in list
expect(document.querySelectorAll('.hover\\:bg-state-base-hover').length).toBe(2)
})
@@ -593,7 +595,7 @@ describe('PluginTasks Component', () => {
render(
)
- expect(document.getElementById('plugin-task-trigger')).toBeInTheDocument()
+ expect(document.getElementById('plugin-task-trigger'))!.toBeInTheDocument()
})
})
@@ -604,7 +606,8 @@ describe('PluginTasks Component', () => {
render(
)
// The component renders with a tooltip, we verify it exists
- expect(document.getElementById('plugin-task-trigger')).toBeInTheDocument()
+ // The component renders with a tooltip, we verify it exists
+ expect(document.getElementById('plugin-task-trigger'))!.toBeInTheDocument()
})
it('should show success tip when all succeeded', () => {
@@ -612,7 +615,7 @@ describe('PluginTasks Component', () => {
render(
)
- expect(document.getElementById('plugin-task-trigger')).toBeInTheDocument()
+ expect(document.getElementById('plugin-task-trigger'))!.toBeInTheDocument()
})
it('should show error tip when some failed', () => {
@@ -623,7 +626,7 @@ describe('PluginTasks Component', () => {
render(
)
- expect(document.getElementById('plugin-task-trigger')).toBeInTheDocument()
+ expect(document.getElementById('plugin-task-trigger'))!.toBeInTheDocument()
})
})
@@ -637,7 +640,8 @@ describe('PluginTasks Component', () => {
fireEvent.click(document.getElementById('plugin-task-trigger')!)
// The popover content should be visible (PluginTaskList)
- expect(document.querySelector('.w-\\[360px\\]')).toBeInTheDocument()
+ // The popover content should be visible (PluginTaskList)
+ expect(document.querySelector('.w-\\[360px\\]'))!.toBeInTheDocument()
})
it('should not toggle when status does not allow', () => {
@@ -647,7 +651,8 @@ describe('PluginTasks Component', () => {
render(
)
// Component should still render
- expect(document.getElementById('plugin-task-trigger')).toBeInTheDocument()
+ // Component should still render
+ expect(document.getElementById('plugin-task-trigger'))!.toBeInTheDocument()
})
})
@@ -665,7 +670,7 @@ describe('PluginTasks Component', () => {
// Wait for popover content to render
await waitFor(() => {
- expect(document.querySelector('.w-\\[360px\\]')).toBeInTheDocument()
+ expect(document.querySelector('.w-\\[360px\\]'))!.toBeInTheDocument()
})
// Find and click clear all button
@@ -691,13 +696,13 @@ describe('PluginTasks Component', () => {
fireEvent.click(document.getElementById('plugin-task-trigger')!)
await waitFor(() => {
- expect(document.querySelector('.w-\\[360px\\]')).toBeInTheDocument()
+ expect(document.querySelector('.w-\\[360px\\]'))!.toBeInTheDocument()
})
// Find and click the clear all button in error section
const clearButtons = screen.getAllByRole('button')
if (clearButtons.length > 0)
- fireEvent.click(clearButtons[0])
+ fireEvent.click(clearButtons[0]!)
await waitFor(() => {
expect(mockMutateAsync).toHaveBeenCalled()
@@ -719,13 +724,13 @@ describe('PluginTasks Component', () => {
fireEvent.click(document.getElementById('plugin-task-trigger')!)
await waitFor(() => {
- expect(document.querySelector('.w-\\[360px\\]')).toBeInTheDocument()
+ expect(document.querySelector('.w-\\[360px\\]'))!.toBeInTheDocument()
})
// Find and click individual clear button (usually the last one)
const clearButtons = screen.getAllByRole('button')
const individualClearButton = clearButtons[clearButtons.length - 1]
- fireEvent.click(individualClearButton)
+ fireEvent.click(individualClearButton!)
await waitFor(() => {
expect(mockMutateAsync).toHaveBeenCalledWith({
@@ -750,7 +755,7 @@ describe('PluginTasks Component', () => {
render(
)
- expect(document.getElementById('plugin-task-trigger')).toBeInTheDocument()
+ expect(document.getElementById('plugin-task-trigger'))!.toBeInTheDocument()
})
it('should handle many plugins', () => {
@@ -763,7 +768,7 @@ describe('PluginTasks Component', () => {
render(
)
- expect(document.getElementById('plugin-task-trigger')).toBeInTheDocument()
+ expect(document.getElementById('plugin-task-trigger'))!.toBeInTheDocument()
})
it('should handle plugins with empty labels', () => {
@@ -775,7 +780,7 @@ describe('PluginTasks Component', () => {
render(
)
- expect(document.getElementById('plugin-task-trigger')).toBeInTheDocument()
+ expect(document.getElementById('plugin-task-trigger'))!.toBeInTheDocument()
})
it('should handle plugins with long messages', () => {
@@ -790,7 +795,7 @@ describe('PluginTasks Component', () => {
// Open popover
fireEvent.click(document.getElementById('plugin-task-trigger')!)
- expect(document.querySelector('.w-\\[360px\\]')).toBeInTheDocument()
+ expect(document.querySelector('.w-\\[360px\\]'))!.toBeInTheDocument()
})
})
})
@@ -809,13 +814,13 @@ describe('PluginTasks Integration', () => {
const { rerender } = render(
)
- expect(document.getElementById('plugin-task-trigger')).toBeInTheDocument()
+ expect(document.getElementById('plugin-task-trigger'))!.toBeInTheDocument()
// Simulate completion by re-rendering with success
setupMocks([createMockPlugin({ status: TaskStatus.success })])
rerender(
)
- expect(document.getElementById('plugin-task-trigger')).toBeInTheDocument()
+ expect(document.getElementById('plugin-task-trigger'))!.toBeInTheDocument()
})
it('should show correct UI flow from installing to failure', async () => {
@@ -824,13 +829,13 @@ describe('PluginTasks Integration', () => {
const { rerender } = render(
)
- expect(document.getElementById('plugin-task-trigger')).toBeInTheDocument()
+ expect(document.getElementById('plugin-task-trigger'))!.toBeInTheDocument()
// Simulate failure by re-rendering with failed
setupMocks([createMockPlugin({ status: TaskStatus.failed, message: 'Network error' })])
rerender(
)
- expect(document.getElementById('plugin-task-trigger')).toBeInTheDocument()
+ expect(document.getElementById('plugin-task-trigger'))!.toBeInTheDocument()
})
it('should handle mixed status during installation', () => {
diff --git a/web/app/components/plugins/plugin-page/plugin-tasks/components/__tests__/plugin-section.spec.tsx b/web/app/components/plugins/plugin-page/plugin-tasks/components/__tests__/plugin-section.spec.tsx
index fb7429e9be..0c724000dd 100644
--- a/web/app/components/plugins/plugin-page/plugin-tasks/components/__tests__/plugin-section.spec.tsx
+++ b/web/app/components/plugins/plugin-page/plugin-tasks/components/__tests__/plugin-section.spec.tsx
@@ -41,15 +41,15 @@ describe('PluginSection', () => {
it('should render title and count', () => {
render(
)
- expect(screen.getByText(/installing plugins/i)).toBeInTheDocument()
+ expect(screen.getByText(/installing plugins/i))!.toBeInTheDocument()
expect(screen.getByText(/installing plugins/i).textContent).toContain('2')
})
it('should render all plugin items', () => {
render(
)
- expect(screen.getByText('PluginA')).toBeInTheDocument()
- expect(screen.getByText('PluginB')).toBeInTheDocument()
+ expect(screen.getByText('PluginA'))!.toBeInTheDocument()
+ expect(screen.getByText('PluginB'))!.toBeInTheDocument()
})
it('should render status icons for each plugin', () => {
@@ -72,14 +72,14 @@ describe('PluginSection', () => {
const plugins = [createPlugin('p1', 'PluginA', 'Custom message')]
render(
)
- expect(screen.getByText('Custom message')).toBeInTheDocument()
+ expect(screen.getByText('Custom message'))!.toBeInTheDocument()
})
it('should use defaultStatusText when plugin has no message', () => {
const plugins = [createPlugin('p1', 'PluginA', '')]
render(
)
- expect(screen.getByText('Default status')).toBeInTheDocument()
+ expect(screen.getByText('Default status'))!.toBeInTheDocument()
})
it('should apply statusClassName to items', () => {
@@ -104,7 +104,7 @@ describe('PluginSection', () => {
/>,
)
- expect(screen.getByRole('button', { name: /clear all/i })).toBeInTheDocument()
+ expect(screen.getByRole('button', { name: /clear all/i }))!.toBeInTheDocument()
})
it('should not render headerAction when not provided', () => {
@@ -123,8 +123,8 @@ describe('PluginSection', () => {
/>,
)
- expect(screen.getByRole('button', { name: /action plugina/i })).toBeInTheDocument()
- expect(screen.getByRole('button', { name: /action pluginb/i })).toBeInTheDocument()
+ expect(screen.getByRole('button', { name: /action plugina/i }))!.toBeInTheDocument()
+ expect(screen.getByRole('button', { name: /action pluginb/i }))!.toBeInTheDocument()
})
})
@@ -140,7 +140,7 @@ describe('PluginSection', () => {
// Clear buttons are rendered when onClearSingle is provided
const clearButtons = screen.getAllByRole('button')
- fireEvent.click(clearButtons[0])
+ fireEvent.click(clearButtons[0]!)
expect(onClearSingle).toHaveBeenCalledWith('task-1', 'p1')
})
@@ -157,8 +157,8 @@ describe('PluginSection', () => {
const plugins = [createPlugin('p1', 'Solo')]
render(
)
- expect(screen.getByText('Solo')).toBeInTheDocument()
- expect(screen.getByText(/solo/i).closest('.max-h-\\[300px\\]')).toBeInTheDocument()
+ expect(screen.getByText('Solo'))!.toBeInTheDocument()
+ expect(screen.getByText(/solo/i).closest('.max-h-\\[300px\\]'))!.toBeInTheDocument()
})
})
})
diff --git a/web/app/components/plugins/plugin-page/plugin-tasks/components/__tests__/plugin-task-list.spec.tsx b/web/app/components/plugins/plugin-page/plugin-tasks/components/__tests__/plugin-task-list.spec.tsx
index 2d0d3f7fd6..07a651e2c5 100644
--- a/web/app/components/plugins/plugin-page/plugin-tasks/components/__tests__/plugin-task-list.spec.tsx
+++ b/web/app/components/plugins/plugin-page/plugin-tasks/components/__tests__/plugin-task-list.spec.tsx
@@ -67,7 +67,7 @@ describe('PluginTaskList', () => {
it('should render empty container when no plugins', () => {
const { container } = render(
)
const wrapper = container.firstElementChild!
- expect(wrapper).toBeInTheDocument()
+ expect(wrapper)!.toBeInTheDocument()
expect(wrapper.children).toHaveLength(0)
})
@@ -77,9 +77,9 @@ describe('PluginTaskList', () => {
// Header contains the title text
const headers = container.querySelectorAll('.system-sm-semibold-uppercase')
expect(headers).toHaveLength(1)
- expect(headers[0].textContent).toContain('plugin.task.installing')
- expect(screen.getByText('OpenAI')).toBeInTheDocument()
- expect(screen.getByText('Anthropic')).toBeInTheDocument()
+ expect(headers[0]!.textContent).toContain('plugin.task.installing')
+ expect(screen.getByText('OpenAI'))!.toBeInTheDocument()
+ expect(screen.getByText('Anthropic'))!.toBeInTheDocument()
})
it('should render success section when success plugins exist', () => {
@@ -87,8 +87,8 @@ describe('PluginTaskList', () => {
const headers = container.querySelectorAll('.system-sm-semibold-uppercase')
expect(headers).toHaveLength(1)
- expect(headers[0].textContent).toContain('plugin.task.installed')
- expect(screen.getByText('Google')).toBeInTheDocument()
+ expect(headers[0]!.textContent).toContain('plugin.task.installed')
+ expect(screen.getByText('Google'))!.toBeInTheDocument()
})
it('should render error section when error plugins exist', () => {
@@ -96,8 +96,8 @@ describe('PluginTaskList', () => {
const headers = container.querySelectorAll('.system-sm-semibold-uppercase')
expect(headers).toHaveLength(1)
- expect(headers[0].textContent).toContain('plugin.task.installedError')
- expect(screen.getByText('DALLE')).toBeInTheDocument()
+ expect(headers[0]!.textContent).toContain('plugin.task.installedError')
+ expect(screen.getByText('DALLE'))!.toBeInTheDocument()
})
it('should render all three sections simultaneously', () => {
@@ -110,9 +110,9 @@ describe('PluginTaskList', () => {
/>,
)
- expect(screen.getByText('OpenAI')).toBeInTheDocument()
- expect(screen.getByText('Google')).toBeInTheDocument()
- expect(screen.getByText('DALLE')).toBeInTheDocument()
+ expect(screen.getByText('OpenAI'))!.toBeInTheDocument()
+ expect(screen.getByText('Google'))!.toBeInTheDocument()
+ expect(screen.getByText('DALLE'))!.toBeInTheDocument()
})
})
@@ -183,6 +183,37 @@ describe('PluginTaskList', () => {
it('should not render clear buttons for running plugins', () => {
render(
)
+ // Running section has no headerAction and no onClearSingle
+ // Running section has no headerAction and no onClearSingle
+ // Running section has no headerAction and no onClearSingle
+ // Running section has no headerAction and no onClearSingle
+ // Running section has no headerAction and no onClearSingle
+ // Running section has no headerAction and no onClearSingle
+ // Running section has no headerAction and no onClearSingle
+ // Running section has no headerAction and no onClearSingle
+ // Running section has no headerAction and no onClearSingle
+ // Running section has no headerAction and no onClearSingle
+ // Running section has no headerAction and no onClearSingle
+ // Running section has no headerAction and no onClearSingle
+ // Running section has no headerAction and no onClearSingle
+ // Running section has no headerAction and no onClearSingle
+ // Running section has no headerAction and no onClearSingle
+ // Running section has no headerAction and no onClearSingle
+ // Running section has no headerAction and no onClearSingle
+ // Running section has no headerAction and no onClearSingle
+ // Running section has no headerAction and no onClearSingle
+ // Running section has no headerAction and no onClearSingle
+ // Running section has no headerAction and no onClearSingle
+ // Running section has no headerAction and no onClearSingle
+ // Running section has no headerAction and no onClearSingle
+ // Running section has no headerAction and no onClearSingle
+ // Running section has no headerAction and no onClearSingle
+ // Running section has no headerAction and no onClearSingle
+ // Running section has no headerAction and no onClearSingle
+ // Running section has no headerAction and no onClearSingle
+ // Running section has no headerAction and no onClearSingle
+ // Running section has no headerAction and no onClearSingle
+ // Running section has no headerAction and no onClearSingle
// Running section has no headerAction and no onClearSingle
expect(screen.queryByText(/plugin\.task\.clearAll/)).not.toBeInTheDocument()
})
@@ -243,9 +274,9 @@ describe('PluginTaskList', () => {
render(
)
- expect(screen.getByText('PluginA')).toBeInTheDocument()
- expect(screen.getByText('PluginB')).toBeInTheDocument()
- expect(screen.getByText('PluginC')).toBeInTheDocument()
+ expect(screen.getByText('PluginA'))!.toBeInTheDocument()
+ expect(screen.getByText('PluginB'))!.toBeInTheDocument()
+ expect(screen.getByText('PluginC'))!.toBeInTheDocument()
})
})
})
diff --git a/web/app/components/plugins/plugin-page/plugin-tasks/components/error-plugin-item.tsx b/web/app/components/plugins/plugin-page/plugin-tasks/components/error-plugin-item.tsx
index 81f559c9aa..ef857cb6c6 100644
--- a/web/app/components/plugins/plugin-page/plugin-tasks/components/error-plugin-item.tsx
+++ b/web/app/components/plugins/plugin-page/plugin-tasks/components/error-plugin-item.tsx
@@ -30,14 +30,14 @@ const ErrorPluginItem: FC
= ({ plugin, getIconUrl, languag
const [org, name] = parts
setIsFetching(true)
try {
- const response = await fetchPluginInfoFromMarketPlace({ org, name })
+ const response = await fetchPluginInfoFromMarketPlace({ org: org!, name: name! })
const info = response.data.plugin
const manifest: Plugin = {
plugin_id: plugin.plugin_id,
type: info.category as Plugin['type'],
category: info.category,
- name,
- org,
+ name: name!,
+ org: org!,
version: info.latest_version,
latest_version: info.latest_version,
latest_package_identifier: info.latest_package_identifier,
diff --git a/web/app/components/plugins/plugin-page/use-uploader.ts b/web/app/components/plugins/plugin-page/use-uploader.ts
index 7df1cb95e3..17699e7b9d 100644
--- a/web/app/components/plugins/plugin-page/use-uploader.ts
+++ b/web/app/components/plugins/plugin-page/use-uploader.ts
@@ -38,7 +38,7 @@ export const useUploader = ({ onFileChange, containerRef, enabled = true }: Uplo
return
const files = Array.from(e.dataTransfer.files)
if (files.length > 0)
- onFileChange(files[0])
+ onFileChange(files[0]!)
}
const fileChangeHandle = enabled
diff --git a/web/app/components/plugins/reference-setting-modal/__tests__/index.spec.tsx b/web/app/components/plugins/reference-setting-modal/__tests__/index.spec.tsx
index 26eeb7fe03..f71780e2df 100644
--- a/web/app/components/plugins/reference-setting-modal/__tests__/index.spec.tsx
+++ b/web/app/components/plugins/reference-setting-modal/__tests__/index.spec.tsx
@@ -148,7 +148,8 @@ describe('reference-setting-modal', () => {
render()
// Assert
- expect(screen.getByText('plugin.privilege.title')).toBeInTheDocument()
+ // Assert
+ expect(screen.getByText('plugin.privilege.title'))!.toBeInTheDocument()
})
it('should render install permission section', () => {
@@ -156,7 +157,8 @@ describe('reference-setting-modal', () => {
render()
// Assert
- expect(screen.getByText('plugin.privilege.whoCanInstall')).toBeInTheDocument()
+ // Assert
+ expect(screen.getByText('plugin.privilege.whoCanInstall'))!.toBeInTheDocument()
})
it('should render debug permission section', () => {
@@ -164,7 +166,8 @@ describe('reference-setting-modal', () => {
render()
// Assert
- expect(screen.getByText('plugin.privilege.whoCanDebug')).toBeInTheDocument()
+ // Assert
+ expect(screen.getByText('plugin.privilege.whoCanDebug'))!.toBeInTheDocument()
})
it('should render all permission options for install', () => {
@@ -180,8 +183,9 @@ describe('reference-setting-modal', () => {
render()
// Assert
- expect(screen.getByText('common.operation.cancel')).toBeInTheDocument()
- expect(screen.getByText('common.operation.save')).toBeInTheDocument()
+ // Assert
+ expect(screen.getByText('common.operation.cancel'))!.toBeInTheDocument()
+ expect(screen.getByText('common.operation.save'))!.toBeInTheDocument()
})
it('should render AutoUpdateSetting when marketplace is enabled', () => {
@@ -192,7 +196,8 @@ describe('reference-setting-modal', () => {
render()
// Assert
- expect(screen.getByTestId('auto-update-setting')).toBeInTheDocument()
+ // Assert
+ expect(screen.getByTestId('auto-update-setting'))!.toBeInTheDocument()
})
it('should not render AutoUpdateSetting when marketplace is disabled', () => {
@@ -202,6 +207,37 @@ describe('reference-setting-modal', () => {
// Act
render()
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
+ // Assert
// Assert
expect(screen.queryByTestId('auto-update-setting')).not.toBeInTheDocument()
})
@@ -211,7 +247,8 @@ describe('reference-setting-modal', () => {
render()
// Assert
- expect(screen.getByTestId('modal-close')).toBeInTheDocument()
+ // Assert
+ expect(screen.getByTestId('modal-close'))!.toBeInTheDocument()
})
})
@@ -230,11 +267,11 @@ describe('reference-setting-modal', () => {
// Assert - admin option should be selected for install (first one)
const adminOptions = screen.getAllByTestId('option-card-plugin.privilege.admins')
- expect(adminOptions[0]).toHaveAttribute('aria-pressed', 'true') // Install permission
+ expect(adminOptions[0])!.toHaveAttribute('aria-pressed', 'true') // Install permission
// Assert - noOne option should be selected for debug (second one)
const noOneOptions = screen.getAllByTestId('option-card-plugin.privilege.noone')
- expect(noOneOptions[1]).toHaveAttribute('aria-pressed', 'true') // Debug permission
+ expect(noOneOptions[1])!.toHaveAttribute('aria-pressed', 'true') // Debug permission
})
it('should update tempPrivilege when permission option is clicked', () => {
@@ -243,10 +280,11 @@ describe('reference-setting-modal', () => {
// Act - click on "No One" for install permission
const noOneOptions = screen.getAllByTestId('option-card-plugin.privilege.noone')
- fireEvent.click(noOneOptions[0]) // First one is for install permission
+ fireEvent.click(noOneOptions[0]!) // First one is for install permission
// Assert - the option should now be selected
- expect(noOneOptions[0]).toHaveAttribute('aria-pressed', 'true')
+ // Assert - the option should now be selected
+ expect(noOneOptions[0])!.toHaveAttribute('aria-pressed', 'true')
})
it('should initialize with payload auto_upgrade values', () => {
@@ -261,7 +299,8 @@ describe('reference-setting-modal', () => {
render()
// Assert
- expect(screen.getByTestId('auto-update-strategy')).toHaveTextContent('latest')
+ // Assert
+ expect(screen.getByTestId('auto-update-strategy'))!.toHaveTextContent('latest')
})
it('should use default auto_upgrade when payload.auto_upgrade is undefined', () => {
@@ -275,7 +314,8 @@ describe('reference-setting-modal', () => {
render()
// Assert - should use default value (disabled)
- expect(screen.getByTestId('auto-update-strategy')).toHaveTextContent('disabled')
+ // Assert - should use default value (disabled)
+ expect(screen.getByTestId('auto-update-strategy'))!.toHaveTextContent('disabled')
})
})
@@ -351,10 +391,11 @@ describe('reference-setting-modal', () => {
// Click Everyone for install permission
const everyoneOptions = screen.getAllByTestId('option-card-plugin.privilege.everyone')
- fireEvent.click(everyoneOptions[0])
+ fireEvent.click(everyoneOptions[0]!)
// Assert
- expect(everyoneOptions[0]).toHaveAttribute('aria-pressed', 'true')
+ // Assert
+ expect(everyoneOptions[0])!.toHaveAttribute('aria-pressed', 'true')
})
it('should update debug permission when Admins Only option is clicked', () => {
@@ -371,10 +412,11 @@ describe('reference-setting-modal', () => {
// Click Admins Only for debug permission (second set of options)
const adminOptions = screen.getAllByTestId('option-card-plugin.privilege.admins')
- fireEvent.click(adminOptions[1]) // Second one is for debug permission
+ fireEvent.click(adminOptions[1]!) // Second one is for debug permission
// Assert
- expect(adminOptions[1]).toHaveAttribute('aria-pressed', 'true')
+ // Assert
+ expect(adminOptions[1])!.toHaveAttribute('aria-pressed', 'true')
})
it('should update auto_upgrade config when changed in AutoUpdateSetting', async () => {
@@ -410,7 +452,8 @@ describe('reference-setting-modal', () => {
rerender()
// Assert - component should render without issues
- expect(screen.getByText('plugin.privilege.title')).toBeInTheDocument()
+ // Assert - component should render without issues
+ expect(screen.getByText('plugin.privilege.title'))!.toBeInTheDocument()
})
it('handleSave should be memoized with useCallback', async () => {
@@ -434,10 +477,11 @@ describe('reference-setting-modal', () => {
// Act - click install permission option
const everyoneOptions = screen.getAllByTestId('option-card-plugin.privilege.everyone')
- fireEvent.click(everyoneOptions[0])
+ fireEvent.click(everyoneOptions[0]!)
// Assert - install permission should be updated
- expect(everyoneOptions[0]).toHaveAttribute('aria-pressed', 'true')
+ // Assert - install permission should be updated
+ expect(everyoneOptions[0])!.toHaveAttribute('aria-pressed', 'true')
})
})
@@ -456,7 +500,7 @@ describe('reference-setting-modal', () => {
// Act & Assert - should not crash
render()
- expect(screen.getByText('plugin.privilege.title')).toBeInTheDocument()
+ expect(screen.getByText('plugin.privilege.title'))!.toBeInTheDocument()
})
it('should handle undefined permission values', () => {
@@ -471,7 +515,7 @@ describe('reference-setting-modal', () => {
// Assert - should use default PermissionType.noOne
const noOneOptions = screen.getAllByTestId('option-card-plugin.privilege.noone')
- expect(noOneOptions[0]).toHaveAttribute('aria-pressed', 'true')
+ expect(noOneOptions[0])!.toHaveAttribute('aria-pressed', 'true')
})
it('should handle missing install_permission', () => {
@@ -487,7 +531,8 @@ describe('reference-setting-modal', () => {
render()
// Assert - should fall back to PermissionType.noOne
- expect(screen.getByText('plugin.privilege.title')).toBeInTheDocument()
+ // Assert - should fall back to PermissionType.noOne
+ expect(screen.getByText('plugin.privilege.title'))!.toBeInTheDocument()
})
it('should handle missing debug_permission', () => {
@@ -503,7 +548,8 @@ describe('reference-setting-modal', () => {
render()
// Assert - should fall back to PermissionType.noOne
- expect(screen.getByText('plugin.privilege.title')).toBeInTheDocument()
+ // Assert - should fall back to PermissionType.noOne
+ expect(screen.getByText('plugin.privilege.title'))!.toBeInTheDocument()
})
it('should handle slow async onSave gracefully', async () => {
@@ -555,7 +601,8 @@ describe('reference-setting-modal', () => {
const { unmount } = render()
// Assert - should render without crashing
- expect(screen.getByText('plugin.privilege.title')).toBeInTheDocument()
+ // Assert - should render without crashing
+ expect(screen.getByText('plugin.privilege.title'))!.toBeInTheDocument()
unmount()
})
@@ -582,7 +629,8 @@ describe('reference-setting-modal', () => {
const { unmount } = render()
// Assert
- expect(screen.getByTestId('auto-update-strategy')).toHaveTextContent(strategy)
+ // Assert
+ expect(screen.getByTestId('auto-update-strategy'))!.toHaveTextContent(strategy)
unmount()
})
@@ -608,7 +656,8 @@ describe('reference-setting-modal', () => {
const { unmount } = render()
// Assert
- expect(screen.getByTestId('auto-update-mode')).toHaveTextContent(mode)
+ // Assert
+ expect(screen.getByTestId('auto-update-mode'))!.toHaveTextContent(mode)
unmount()
})
@@ -631,7 +680,7 @@ describe('reference-setting-modal', () => {
// Change install permission to noOne
const noOneOptions = screen.getAllByTestId('option-card-plugin.privilege.noone')
- fireEvent.click(noOneOptions[0])
+ fireEvent.click(noOneOptions[0]!)
// Save
fireEvent.click(screen.getByText('common.operation.save'))
@@ -662,7 +711,7 @@ describe('reference-setting-modal', () => {
// Change debug permission to noOne
const noOneOptions = screen.getAllByTestId('option-card-plugin.privilege.noone')
- fireEvent.click(noOneOptions[1]) // Second one is for debug
+ fireEvent.click(noOneOptions[1]!) // Second one is for debug
// Save
fireEvent.click(screen.getByText('common.operation.save'))
@@ -691,7 +740,7 @@ describe('reference-setting-modal', () => {
// Change install permission
const everyoneOptions = screen.getAllByTestId('option-card-plugin.privilege.everyone')
- fireEvent.click(everyoneOptions[0])
+ fireEvent.click(everyoneOptions[0]!)
// Save
fireEvent.click(screen.getByText('common.operation.save'))
@@ -717,7 +766,7 @@ describe('reference-setting-modal', () => {
// Assert
const modal = screen.getByTestId('modal')
- expect(modal).toHaveClass('w-[620px]', 'max-w-[620px]', 'p-0!')
+ expect(modal)!.toHaveClass('w-[620px]', 'max-w-[620px]', 'p-0!')
})
it('should pass isShow=true to Modal', () => {
@@ -725,7 +774,8 @@ describe('reference-setting-modal', () => {
render()
// Assert - modal should be visible
- expect(screen.getByTestId('modal')).toBeInTheDocument()
+ // Assert - modal should be visible
+ expect(screen.getByTestId('modal'))!.toBeInTheDocument()
})
})
@@ -736,8 +786,8 @@ describe('reference-setting-modal', () => {
// Assert - check order by getting all section labels
const labels = screen.getAllByText(/plugin\.privilege\.whoCan/)
- expect(labels[0]).toHaveTextContent('plugin.privilege.whoCanInstall')
- expect(labels[1]).toHaveTextContent('plugin.privilege.whoCanDebug')
+ expect(labels[0])!.toHaveTextContent('plugin.privilege.whoCanInstall')
+ expect(labels[1])!.toHaveTextContent('plugin.privilege.whoCanDebug')
})
it('should render three options per permission section', () => {
@@ -762,8 +812,8 @@ describe('reference-setting-modal', () => {
const cancelButton = screen.getByText('common.operation.cancel')
const saveButton = screen.getByText('common.operation.save')
- expect(cancelButton).toBeInTheDocument()
- expect(saveButton).toBeInTheDocument()
+ expect(cancelButton)!.toBeInTheDocument()
+ expect(saveButton)!.toBeInTheDocument()
})
})
})
@@ -797,11 +847,11 @@ describe('reference-setting-modal', () => {
// Change install permission to Everyone
const everyoneOptions = screen.getAllByTestId('option-card-plugin.privilege.everyone')
- fireEvent.click(everyoneOptions[0])
+ fireEvent.click(everyoneOptions[0]!)
// Change debug permission to Admins Only
const adminOptions = screen.getAllByTestId('option-card-plugin.privilege.admins')
- fireEvent.click(adminOptions[1])
+ fireEvent.click(adminOptions[1]!)
// Change auto-update strategy
fireEvent.click(screen.getByTestId('auto-update-change'))
@@ -841,7 +891,7 @@ describe('reference-setting-modal', () => {
// Make some changes
const noOneOptions = screen.getAllByTestId('option-card-plugin.privilege.noone')
- fireEvent.click(noOneOptions[0])
+ fireEvent.click(noOneOptions[0]!)
// Cancel
fireEvent.click(screen.getByText('common.operation.cancel'))
@@ -863,8 +913,9 @@ describe('reference-setting-modal', () => {
render()
// Assert - Labels are rendered correctly
- expect(screen.getByText('plugin.privilege.whoCanInstall')).toBeInTheDocument()
- expect(screen.getByText('plugin.privilege.whoCanDebug')).toBeInTheDocument()
+ // Assert - Labels are rendered correctly
+ expect(screen.getByText('plugin.privilege.whoCanInstall'))!.toBeInTheDocument()
+ expect(screen.getByText('plugin.privilege.whoCanDebug'))!.toBeInTheDocument()
})
})
})
diff --git a/web/app/components/plugins/update-plugin/plugin-version-picker.tsx b/web/app/components/plugins/update-plugin/plugin-version-picker.tsx
index 0266c05069..d590f0c9eb 100644
--- a/web/app/components/plugins/update-plugin/plugin-version-picker.tsx
+++ b/web/app/components/plugins/update-plugin/plugin-version-picker.tsx
@@ -107,7 +107,7 @@ const PluginVersionPicker: FC = ({
{version.version}
{currentVersion === version.version && }