Prettier 2.0 (#393)

This commit is contained in:
Steve Faulkner
2021-01-20 09:15:01 -06:00
committed by GitHub
parent c1937ca464
commit 4be53284b5
500 changed files with 41927 additions and 41838 deletions

View File

@@ -38,7 +38,7 @@ describe("Collection Add and Delete Cassandra spec", () => {
await frame.waitForSelector('div[class="splashScreen"] > div[class="title"]', { visible: true });
const databases = await frame.$$(`div[class="databaseHeader main1 nodeItem "] > div[class="treeNodeHeader "]`);
const selectedDbId = await frame.evaluate(element => {
const selectedDbId = await frame.evaluate((element) => {
return element.attributes["data-test"].textContent;
}, databases[0]);
@@ -46,8 +46,8 @@ describe("Collection Add and Delete Cassandra spec", () => {
await frame.waitFor(CREATE_DELAY);
await frame.waitFor("div[class='rowData'] > span[class='message']");
const didCreateContainer = await frame.$$eval("div[class='rowData'] > span[class='message']", elements => {
return elements.some(el => el.textContent.includes("Successfully created"));
const didCreateContainer = await frame.$$eval("div[class='rowData'] > span[class='message']", (elements) => {
return elements.some((el) => el.textContent.includes("Successfully created"));
});
expect(didCreateContainer).toBe(true);
@@ -63,10 +63,10 @@ describe("Collection Add and Delete Cassandra spec", () => {
if (collections.length) {
await frame.waitFor(`div[class="collectionHeader main2 nodeItem "] > div[class="treeNodeHeader "]`, {
visible: true
visible: true,
});
const textId = await frame.evaluate(element => {
const textId = await frame.evaluate((element) => {
return element.attributes["data-test"].textContent;
}, collections[0]);
await frame.waitFor(`div[data-test="${textId}"]`, { visible: true });
@@ -138,7 +138,7 @@ async function clickDBMenu(dbId: string, frame: Frame, retries = 0) {
async function ensureMenuIsOpen(dbId: string, frame: Frame, retries: number) {
await frame.waitFor(RETRY_DELAY);
const button = await frame.$(`div[data-test="${dbId}"]`);
const classList = await frame.evaluate(button => {
const classList = await frame.evaluate((button) => {
return button.parentElement.classList;
}, button);
if (!Object.values(classList).includes("selected") && retries < 5) {

View File

@@ -58,7 +58,7 @@ describe("Collection Add and Delete Mongo spec", () => {
await frame.waitForSelector('div[class="splashScreen"] > div[class="title"]', { visible: true });
const databases = await frame.$$(`div[class="databaseHeader main1 nodeItem "] > div[class="treeNodeHeader "]`);
const selectedDbId = await frame.evaluate(element => {
const selectedDbId = await frame.evaluate((element) => {
return element.attributes["data-test"].textContent;
}, databases[0]);
@@ -66,8 +66,8 @@ describe("Collection Add and Delete Mongo spec", () => {
await frame.waitFor(CREATE_DELAY);
await frame.waitFor("div[class='rowData'] > span[class='message']");
const didCreateContainer = await frame.$$eval("div[class='rowData'] > span[class='message']", elements => {
return elements.some(el => el.textContent.includes("Successfully created"));
const didCreateContainer = await frame.$$eval("div[class='rowData'] > span[class='message']", (elements) => {
return elements.some((el) => el.textContent.includes("Successfully created"));
});
expect(didCreateContainer).toBe(true);
@@ -82,7 +82,7 @@ describe("Collection Add and Delete Mongo spec", () => {
);
if (collections.length) {
const textId = await frame.evaluate(element => {
const textId = await frame.evaluate((element) => {
return element.attributes["data-test"].textContent;
}, collections[0]);
await frame.waitFor(`div[data-test="${textId}"]`, { visible: true });
@@ -154,7 +154,7 @@ async function clickDBMenu(dbId: string, frame: Frame, retries = 0) {
async function ensureMenuIsOpen(dbId: string, frame: Frame, retries: number) {
await frame.waitFor(RETRY_DELAY);
const button = await frame.$(`div[data-test="${dbId}"]`);
const classList = await frame.evaluate(button => {
const classList = await frame.evaluate((button) => {
return button.parentElement.classList;
}, button);
if (!Object.values(classList).includes("selected") && retries < 5) {

View File

@@ -42,7 +42,7 @@ export const getNotebookNode = async (frame: Frame, uploadNotebookName: string):
const treeNodeHeaders = await notebookResourceTree.$$(".treeNodeHeader");
for (let i = 1; i < treeNodeHeaders.length; i++) {
currentNotebookNode = treeNodeHeaders[i];
const nodeLabel = await currentNotebookNode.$eval(".nodeLabel", element => element.textContent);
const nodeLabel = await currentNotebookNode.$eval(".nodeLabel", (element) => element.textContent);
if (nodeLabel === uploadNotebookName) {
return currentNotebookNode;
}

View File

@@ -16,7 +16,7 @@ describe("Notebook UI tests", () => {
uploadedNotebookNode = await uploadNotebookIfNotExist(frame, notebookName);
await uploadedNotebookNode.click();
await frame.waitForSelector(".tabNavText");
const tabTitle = await frame.$eval(".tabNavText", element => element.textContent);
const tabTitle = await frame.$eval(".tabNavText", (element) => element.textContent);
expect(tabTitle).toEqual(notebookName);
const closeIcon = await frame.waitForSelector(".close-Icon");
await closeIcon.click();

View File

@@ -57,7 +57,7 @@ describe("Collection Add and Delete SQL spec", () => {
await frame.waitFor(CREATE_DELAY);
await frame.waitForSelector('div[class="splashScreen"] > div[class="title"]', { visible: true });
const databases = await frame.$$(`div[class="databaseHeader main1 nodeItem "] > div[class="treeNodeHeader "]`);
const selectedDbId = await frame.evaluate(element => {
const selectedDbId = await frame.evaluate((element) => {
return element.attributes["data-test"].textContent;
}, databases[0]);
@@ -65,8 +65,8 @@ describe("Collection Add and Delete SQL spec", () => {
await frame.waitFor(CREATE_DELAY);
await frame.waitFor("div[class='rowData'] > span[class='message']");
const didCreateContainer = await frame.$$eval("div[class='rowData'] > span[class='message']", elements => {
return elements.some(el => el.textContent.includes("Successfully created"));
const didCreateContainer = await frame.$$eval("div[class='rowData'] > span[class='message']", (elements) => {
return elements.some((el) => el.textContent.includes("Successfully created"));
});
expect(didCreateContainer).toBe(true);
@@ -82,10 +82,10 @@ describe("Collection Add and Delete SQL spec", () => {
if (collections.length) {
await frame.waitFor(`div[class="collectionHeader main2 nodeItem "] > div[class="treeNodeHeader "]`, {
visible: true
visible: true,
});
const textId = await frame.evaluate(element => {
const textId = await frame.evaluate((element) => {
return element.attributes["data-test"].textContent;
}, collections[0]);
await frame.waitFor(`div[data-test="${textId}"]`, { visible: true });
@@ -157,7 +157,7 @@ async function clickDBMenu(dbId: string, frame: Frame, retries = 0) {
async function ensureMenuIsOpen(dbId: string, frame: Frame, retries: number) {
await frame.waitFor(RETRY_DELAY);
const button = await frame.$(`div[data-test="${dbId}"]`);
const classList = await frame.evaluate(button => {
const classList = await frame.evaluate((button) => {
return button.parentElement.classList;
}, button);
if (!Object.values(classList).includes("selected") && retries < 5) {

View File

@@ -21,7 +21,7 @@ describe("Collection Add and Delete SQL spec", () => {
const { resource: containerPermission } = await user.permissions.upsert({
id: "partitionLevelPermission",
permissionMode: PermissionMode.All,
resource: container.url
resource: container.url,
});
const resourceTokenConnectionString = `AccountEndpoint=${endpoint};DatabaseId=${database.id};CollectionId=${container.id};${containerPermission._token}`;
try {
@@ -60,7 +60,7 @@ async function clickDBMenu(dbId: string, frame: Frame, retries = 0) {
async function ensureMenuIsOpen(dbId: string, frame: Frame, retries: number) {
await frame.waitFor(RETRY_DELAY);
const button = await frame.$(`div[data-test="${dbId}"]`);
const classList = await frame.evaluate(button => {
const classList = await frame.evaluate((button) => {
return button.parentElement.classList;
}, button);
if (!Object.values(classList).includes("selected") && retries < 5) {

View File

@@ -37,8 +37,8 @@ describe("Collection Add and Delete Tables spec", () => {
await frame.waitFor(`div[data-test="TablesDB"]`), { visible: true };
await frame.waitFor(LOADING_STATE_DELAY);
const didCreateContainer = await frame.$$eval("div[class='rowData'] > span[class='message']", elements => {
return elements.some(el => el.textContent.includes("Successfully created"));
const didCreateContainer = await frame.$$eval("div[class='rowData'] > span[class='message']", (elements) => {
return elements.some((el) => el.textContent.includes("Successfully created"));
});
expect(didCreateContainer).toBe(true);
@@ -51,7 +51,7 @@ describe("Collection Add and Delete Tables spec", () => {
const collections = await frame.$$(
`div[class="collectionHeader main2 nodeItem "] > div[class="treeNodeHeader "]`
);
const textId = await frame.evaluate(element => {
const textId = await frame.evaluate((element) => {
return element.attributes["data-test"].textContent;
}, collections[0]);
await frame.waitFor(`div[data-test="${textId}"]`, { visible: true });
@@ -101,7 +101,7 @@ async function clickTablesMenu(frame: Frame, retries = 0) {
async function ensureMenuIsOpen(frame: Frame, retries: number) {
await frame.waitFor(RETRY_DELAY);
const button = await frame.$(`div[data-test="TablesDB"]`);
const classList = await frame.evaluate(button => {
const classList = await frame.evaluate((button) => {
return button.parentElement.classList;
}, button);
if (!Object.values(classList).includes("selected") && retries < 5) {

View File

@@ -58,7 +58,7 @@ const sendMessageToExplorerFrame = (data: unknown): void => {
explorerFrame.contentWindow.postMessage(
{
signature: "pcIframe",
data: data
data: data,
},
explorerFrame.contentDocument.referrer || window.location.href
);
@@ -126,12 +126,12 @@ const initTestExplorer = async (): Promise<void> => {
sharedThroughputDefault: 400,
defaultCollectionThroughput: {
storage: "100",
throughput: { fixed: 400, unlimited: 400, unlimitedmax: 100000, unlimitedmin: 400, shared: 400 }
throughput: { fixed: 400, unlimited: 400, unlimitedmax: 100000, unlimitedmin: 400, shared: 400 },
},
// add UI test only when feature is not dependent on flights anymore
flights: [],
selfServeType: selfServeType
} as ViewModels.DataExplorerInputsFrame
selfServeType: selfServeType,
} as ViewModels.DataExplorerInputsFrame,
};
window.postMessage(initTestExplorerContent, window.location.href);

View File

@@ -6,5 +6,5 @@ export enum TestExplorerParams {
portalRunnerDatabaseAccountKey = "portalRunnerDatabaseAccountKey",
portalRunnerSubscripton = "portalRunnerSubscripton",
portalRunnerResourceGroup = "portalRunnerResourceGroup",
selfServeType = "selfServeType"
selfServeType = "selfServeType",
}