Fix Unit and E2E tests (#2112)

* fix tests

* remove Materialized Views from createResourceTokenTreeNodes

---------

Co-authored-by: Asier Isayas <aisayas@microsoft.com>
This commit is contained in:
asier-isayas 2025-04-16 10:05:36 -04:00 committed by GitHub
parent 94b1e729d1
commit d5fe2d9e9f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 5 additions and 6 deletions

View File

@ -76,7 +76,7 @@ exports[`AddGlobalSecondaryIndexPanel render default panel 1`] = `
className="panelTextField" className="panelTextField"
id="globalSecondaryIndexId" id="globalSecondaryIndexId"
onChange={[Function]} onChange={[Function]}
pattern="[^/?#\\\\]*[^/?# \\\\]" pattern="[^\\/?#\\\\]*[^\\/?# \\\\]"
placeholder="e.g., indexbyEmailId" placeholder="e.g., indexbyEmailId"
required={true} required={true}
size={40} size={40}

View File

@ -1,7 +1,6 @@
import { Tree, TreeItemValue, TreeOpenChangeData, TreeOpenChangeEvent } from "@fluentui/react-components"; import { Tree, TreeItemValue, TreeOpenChangeData, TreeOpenChangeEvent } from "@fluentui/react-components";
import { Home16Regular } from "@fluentui/react-icons"; import { Home16Regular } from "@fluentui/react-icons";
import { AuthType } from "AuthType"; import { AuthType } from "AuthType";
import { Collection } from "Contracts/ViewModels";
import { useTreeStyles } from "Explorer/Controls/TreeComponent/Styles"; import { useTreeStyles } from "Explorer/Controls/TreeComponent/Styles";
import { TreeNode, TreeNodeComponent } from "Explorer/Controls/TreeComponent/TreeNodeComponent"; import { TreeNode, TreeNodeComponent } from "Explorer/Controls/TreeComponent/TreeNodeComponent";
import { import {
@ -61,7 +60,7 @@ export const ResourceTree: React.FC<ResourceTreeProps> = ({ explorer }: Resource
const databaseTreeNodes = useMemo(() => { const databaseTreeNodes = useMemo(() => {
return userContext.authType === AuthType.ResourceToken return userContext.authType === AuthType.ResourceToken
? createResourceTokenTreeNodes(resourceTokenCollection as Collection) ? createResourceTokenTreeNodes(resourceTokenCollection)
: createDatabaseTreeNodes(explorer, isNotebookEnabled, databases, refreshActiveTab); : createDatabaseTreeNodes(explorer, isNotebookEnabled, databases, refreshActiveTab);
}, [resourceTokenCollection, databases, isNotebookEnabled, refreshActiveTab]); }, [resourceTokenCollection, databases, isNotebookEnabled, refreshActiveTab]);

View File

@ -2412,7 +2412,7 @@ exports[`createResourceTokenTreeNodes creates the expected tree nodes 1`] = `
}, },
], ],
"className": "collectionNode", "className": "collectionNode",
"iconSrc": <EyeRegular "iconSrc": <DocumentMultipleRegular
fontSize={16} fontSize={16}
/>, />,
"isExpanded": true, "isExpanded": true,

View File

@ -81,7 +81,7 @@ export const createSampleDataTreeNodes = (sampleDataResourceTokenCollection: Vie
return [updatedSampleTree]; return [updatedSampleTree];
}; };
export const createResourceTokenTreeNodes = (collection: ViewModels.Collection): TreeNode[] => { export const createResourceTokenTreeNodes = (collection: ViewModels.CollectionBase): TreeNode[] => {
if (!collection) { if (!collection) {
return [ return [
{ {
@ -111,7 +111,7 @@ export const createResourceTokenTreeNodes = (collection: ViewModels.Collection):
isExpanded: true, isExpanded: true,
children, children,
className: "collectionNode", className: "collectionNode",
iconSrc: collection.materializedViewDefinition() ? GlobalSecondaryIndexCollectionIcon : TreeCollectionIcon, iconSrc: TreeCollectionIcon,
onClick: () => { onClick: () => {
// Rewritten version of expandCollapseCollection // Rewritten version of expandCollapseCollection
useSelectedNode.getState().setSelectedNode(collection); useSelectedNode.getState().setSelectedNode(collection);