mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-18 16:31:31 +00:00
Pk missing fix (#2094)
* fix partition key missing not being able to load the document * Implement E2E tests for documents with different partitionkeys * Implement E2E tests for documents with different partitionkeys * Implement E2E tests for documents with different partitionkeys * Updated snapshot
This commit is contained in:
33
test/fx.ts
33
test/fx.ts
@@ -26,7 +26,7 @@ export function getAzureCLICredentials(): AzureCliCredential {
|
||||
|
||||
export async function getAzureCLICredentialsToken(): Promise<string> {
|
||||
const credentials = getAzureCLICredentials();
|
||||
const token = (await credentials.getToken("https://management.core.windows.net//.default")).token;
|
||||
const token = (await credentials.getToken("https://management.core.windows.net//.default"))?.token || "";
|
||||
return token;
|
||||
}
|
||||
|
||||
@@ -37,6 +37,7 @@ export enum TestAccount {
|
||||
Mongo = "Mongo",
|
||||
Mongo32 = "Mongo32",
|
||||
SQL = "SQL",
|
||||
SQLReadOnly = "SQLReadOnly",
|
||||
}
|
||||
|
||||
export const defaultAccounts: Record<TestAccount, string> = {
|
||||
@@ -46,6 +47,7 @@ export const defaultAccounts: Record<TestAccount, string> = {
|
||||
[TestAccount.Mongo]: "github-e2etests-mongo",
|
||||
[TestAccount.Mongo32]: "github-e2etests-mongo32",
|
||||
[TestAccount.SQL]: "github-e2etests-sql",
|
||||
[TestAccount.SQLReadOnly]: "github-e2etests-sql-readonly",
|
||||
};
|
||||
|
||||
export const resourceGroupName = process.env.DE_TEST_RESOURCE_GROUP ?? "de-e2e-tests";
|
||||
@@ -214,6 +216,25 @@ export class QueryTab {
|
||||
}
|
||||
}
|
||||
|
||||
export class DocumentsTab {
|
||||
documentsFilter: Locator;
|
||||
documentsListPane: Locator;
|
||||
documentResultsPane: Locator;
|
||||
resultsEditor: Editor;
|
||||
|
||||
constructor(
|
||||
public frame: Frame,
|
||||
public tabId: string,
|
||||
public tab: Locator,
|
||||
public locator: Locator,
|
||||
) {
|
||||
this.documentsFilter = this.locator.getByTestId("DocumentsTab/Filter");
|
||||
this.documentsListPane = this.locator.getByTestId("DocumentsTab/DocumentsPane");
|
||||
this.documentResultsPane = this.locator.getByTestId("DocumentsTab/ResultsPane");
|
||||
this.resultsEditor = new Editor(this.frame, this.documentResultsPane.getByTestId("EditorReact/Host/Loaded"));
|
||||
}
|
||||
}
|
||||
|
||||
type PanelOpenOptions = {
|
||||
closeTimeout?: number;
|
||||
};
|
||||
@@ -232,6 +253,12 @@ export class DataExplorer {
|
||||
return new QueryTab(this.frame, tabId, tab, queryTab);
|
||||
}
|
||||
|
||||
documentsTab(tabId: string): DocumentsTab {
|
||||
const tab = this.tab(tabId);
|
||||
const documentsTab = tab.getByTestId("DocumentsTab");
|
||||
return new DocumentsTab(this.frame, tabId, tab, documentsTab);
|
||||
}
|
||||
|
||||
/** Select the primary global command button.
|
||||
*
|
||||
* There's only a single "primary" button, but we still require you to pass the label to confirm you're selecting the right button.
|
||||
@@ -294,6 +321,10 @@ export class DataExplorer {
|
||||
return await this.waitForNode(`${databaseId}/${containerId}`);
|
||||
}
|
||||
|
||||
async waitForContainerItemsNode(databaseId: string, containerId: string): Promise<TreeNode> {
|
||||
return await this.waitForNode(`${databaseId}/${containerId}/Items`);
|
||||
}
|
||||
|
||||
/** Select the tree node with the specified id */
|
||||
treeNode(id: string): TreeNode {
|
||||
return new TreeNode(this.frame.getByTestId(`TreeNode:${id}`), this.frame, id);
|
||||
|
||||
Reference in New Issue
Block a user