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"
id="globalSecondaryIndexId"
onChange={[Function]}
pattern="[^/?#\\\\]*[^/?# \\\\]"
pattern="[^\\/?#\\\\]*[^\\/?# \\\\]"
placeholder="e.g., indexbyEmailId"
required={true}
size={40}

View File

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

View File

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

View File

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