@fluidframework/azure-end-to-end-tests 1.2.0-106934 → 1.2.0-111554

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,5 +8,5 @@
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.pkgVersion = exports.pkgName = void 0;
10
10
  exports.pkgName = "@fluidframework/azure-end-to-end-tests";
11
- exports.pkgVersion = "1.2.0-106934";
11
+ exports.pkgVersion = "1.2.0-111554";
12
12
  //# sourceMappingURL=packageVersion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,wCAAwC,CAAC;AACnD,QAAA,UAAU,GAAG,cAAc,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/azure-end-to-end-tests\";\nexport const pkgVersion = \"1.2.0-106934\";\n"]}
1
+ {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,wCAAwC,CAAC;AACnD,QAAA,UAAU,GAAG,cAAc,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/azure-end-to-end-tests\";\nexport const pkgVersion = \"1.2.0-111554\";\n"]}
@@ -46,13 +46,18 @@ describe("Container copy scenarios", () => {
46
46
  assert_1.strict.strictEqual(versions.length, 1, "Container should have exactly one version.");
47
47
  });
48
48
  /**
49
- * Scenario: test if Azure Client can handle bad version ID when versions are requested.
49
+ * Scenario: test if Azure Client can handle bad document ID when versions are requested.
50
50
  *
51
51
  * Expected behavior: Client should throw an error.
52
52
  */
53
- it("can handle bad versions of current document", async () => {
53
+ it("can handle bad document id when requesting versions", async () => {
54
54
  const resources = client.getContainerVersions("badid");
55
- await assert_1.strict.rejects(resources, () => true, "We should not be able to get container versions.");
55
+ const errorFn = (error) => {
56
+ assert_1.strict.notStrictEqual(error.message, undefined, "Azure Client error is undefined");
57
+ assert_1.strict.strictEqual(error.message, "R11s fetch error: Document is deleted and cannot be accessed.", `Unexpected error: ${error.message}`);
58
+ return true;
59
+ };
60
+ await assert_1.strict.rejects(resources, errorFn, "We should not be able to get container versions.");
56
61
  });
57
62
  /**
58
63
  * Scenario: test if Azure Client can copy existing container.
@@ -136,7 +141,12 @@ describe("Container copy scenarios", () => {
136
141
  */
137
142
  it("can handle non-existing container", async () => {
138
143
  const resources = client.copyContainer("badidoncopy", schema);
139
- await assert_1.strict.rejects(resources, () => true, "We should not be able to copy container.");
144
+ const errorFn = (error) => {
145
+ assert_1.strict.notStrictEqual(error.message, undefined, "Azure Client error is undefined");
146
+ assert_1.strict.strictEqual(error.message, "R11s fetch error: Document is deleted and cannot be accessed.", `Unexpected error: ${error.message}`);
147
+ return true;
148
+ };
149
+ await assert_1.strict.rejects(resources, errorFn, "We should not be able to copy container.");
140
150
  });
141
151
  });
142
152
  //# sourceMappingURL=containerCopy.spec.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"containerCopy.spec.js","sourceRoot":"","sources":["../../src/test/containerCopy.spec.ts"],"names":[],"mappings":";;AAAA;;;GAGG;AACH,mCAA0C;AAC1C,iFAAoE;AAEpE,6CAAgD;AAChD,2DAA4D;AAE5D,6DAAyD;AACzD,mCAAkC;AAElC,QAAQ,CAAC,0BAA0B,EAAE,GAAG,EAAE;IACtC,MAAM,gBAAgB,GAAG,IAAI,CAAC;IAC9B,IAAI,MAAmB,CAAC;IACxB,IAAI,MAAuB,CAAC;IAE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qCAAqC,CAAC,CAAC;IACrF,CAAC,CAAC,CAAC;IAEH;;;;OAIG;IACH,EAAE,CAAC,mCAAmC,EAAE,KAAK,IAAI,EAAE;QAC/C,MAAM,SAAS,GAAG,MAAM,CAAC,aAAa,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;QAC9D,MAAM,eAAM,CAAC,OAAO,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,IAAI,EAAE,0CAA0C,CAAC,CAAC;IAC5F,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport { strict as assert } from \"assert\";\nimport { AttachState } from \"@fluidframework/container-definitions\";\nimport { ContainerSchema } from \"@fluidframework/fluid-static\";\nimport { SharedMap } from \"@fluidframework/map\";\nimport { timeoutPromise } from \"@fluidframework/test-utils\";\nimport { AzureClient } from \"@fluidframework/azure-client\";\nimport { createAzureClient } from \"./AzureClientFactory\";\nimport { mapWait } from \"./utils\";\n\ndescribe(\"Container copy scenarios\", () => {\n const connectTimeoutMs = 1000;\n let client: AzureClient;\n let schema: ContainerSchema;\n\n beforeEach(() => {\n client = createAzureClient();\n schema = {\n initialObjects: {\n map1: SharedMap,\n },\n };\n });\n\n beforeEach(async function () {\n if (process.env.FLUID_CLIENT !== \"azure\") {\n this.skip();\n }\n });\n\n /**\n * Scenario: test if Azure Client can provide versions of the container.\n *\n * Expected behavior: an error should not be thrown nor should a rejected promise\n * be returned. Upon creation, we should recieve back 1 version of the container.\n */\n it(\"can get versions of current document\", async () => {\n const { container } = await client.createContainer(schema);\n const containerId = await container.attach();\n\n await timeoutPromise((resolve) => container.once(\"connected\", () => resolve()), {\n durationMs: connectTimeoutMs,\n errorMsg: \"container connect() timeout\",\n });\n const resources = client.getContainerVersions(containerId);\n await assert.doesNotReject(\n resources,\n () => true,\n \"could not get versions of the container\",\n );\n\n const versions = await resources;\n assert.strictEqual(versions.length, 1, \"Container should have exactly one version.\");\n });\n\n /**\n * Scenario: test if Azure Client can handle bad version ID when versions are requested.\n *\n * Expected behavior: Client should throw an error.\n */\n it(\"can handle bad versions of current document\", async () => {\n const resources = client.getContainerVersions(\"badid\");\n await assert.rejects(\n resources,\n () => true,\n \"We should not be able to get container versions.\",\n );\n });\n\n /**\n * Scenario: test if Azure Client can copy existing container.\n *\n * Expected behavior: an error should not be thrown nor should a rejected promise\n * be returned.\n */\n it(\"can copy document successfully\", async () => {\n const { container } = await client.createContainer(schema);\n const containerId = await container.attach();\n\n await timeoutPromise((resolve) => container.once(\"connected\", () => resolve()), {\n durationMs: connectTimeoutMs,\n errorMsg: \"container connect() timeout\",\n });\n const resources = client.copyContainer(containerId, schema);\n await assert.doesNotReject(resources, () => true, \"container could not be copied\");\n\n const { container: containerCopy } = await resources;\n\n const newContainerId = await containerCopy.attach();\n await timeoutPromise((resolve) => containerCopy.once(\"connected\", () => resolve()), {\n durationMs: connectTimeoutMs,\n errorMsg: \"container connect() timeout\",\n });\n\n assert.strictEqual(typeof newContainerId, \"string\", \"Attach did not return a string ID\");\n assert.strictEqual(\n containerCopy.attachState,\n AttachState.Attached,\n \"Container is not attached after attach is called\",\n );\n });\n\n /**\n * Scenario: test if Azure Client can copy existing container at specific version.\n *\n * Expected behavior: an error should not be thrown nor should a rejected promise\n * be returned.\n */\n it(\"can sucesfully copy document from a specific version\", async () => {\n const { container } = await client.createContainer(schema);\n const containerId = await container.attach();\n\n await timeoutPromise((resolve) => container.once(\"connected\", () => resolve()), {\n durationMs: connectTimeoutMs,\n errorMsg: \"container connect() timeout\",\n });\n\n const versions = await client.getContainerVersions(containerId);\n assert.strictEqual(versions.length, 1, \"Container should have exactly one version.\");\n\n const resources = client.copyContainer(containerId, schema, versions[0]);\n await assert.doesNotReject(resources, () => true, \"container could not be copied\");\n\n const { container: containerCopy } = await resources;\n\n const newContainerId = await containerCopy.attach();\n await timeoutPromise((resolve) => containerCopy.once(\"connected\", () => resolve()), {\n durationMs: connectTimeoutMs,\n errorMsg: \"container connect() timeout\",\n });\n\n assert.strictEqual(typeof newContainerId, \"string\", \"Attach did not return a string ID\");\n assert.strictEqual(\n containerCopy.attachState,\n AttachState.Attached,\n \"Container is not attached after attach is called\",\n );\n });\n\n /**\n * Scenario: test if Azure Client properly handles DDS objects when\n * copying existing container.\n *\n * Expected behavior: DDS values should match across original and copied\n * container.\n */\n it(\"correctly copies DDS values when copying container\", async () => {\n const { container } = await client.createContainer(schema);\n\n const initialObjectsCreate = container.initialObjects;\n const map1Create = initialObjectsCreate.map1 as SharedMap;\n map1Create.set(\"new-key\", \"new-value\");\n const valueCreate: string | undefined = map1Create.get(\"new-key\");\n\n const containerId = await container.attach();\n\n await timeoutPromise((resolve) => container.once(\"connected\", () => resolve()), {\n durationMs: connectTimeoutMs,\n errorMsg: \"container connect() timeout\",\n });\n\n const resources = client.copyContainer(containerId, schema);\n await assert.doesNotReject(resources, () => true, \"container could not be copied\");\n\n const { container: containerCopy } = await resources;\n\n const map1Get = containerCopy.initialObjects.map1 as SharedMap;\n const valueGet: string | undefined = await mapWait(map1Get, \"new-key\");\n assert.strictEqual(valueGet, valueCreate, \"DDS value was not correctly copied.\");\n });\n\n /**\n * Scenario: test if Azure Client can handle non-existing container when trying to copy\n *\n * Expected behavior: client should throw an error.\n */\n it(\"can handle non-existing container\", async () => {\n const resources = client.copyContainer(\"badidoncopy\", schema);\n await assert.rejects(resources, () => true, \"We should not be able to copy container.\");\n });\n});\n"]}
1
+ {"version":3,"file":"containerCopy.spec.js","sourceRoot":"","sources":["../../src/test/containerCopy.spec.ts"],"names":[],"mappings":";;AAAA;;;GAGG;AACH,mCAA0C;AAC1C,iFAAoE;AAEpE,6CAAgD;AAChD,2DAA4D;AAE5D,6DAAyD;AACzD,mCAAkC;AAElC,QAAQ,CAAC,0BAA0B,EAAE,GAAG,EAAE;IACtC,MAAM,gBAAgB,GAAG,IAAI,CAAC;IAC9B,IAAI,MAAmB,CAAC;IACxB,IAAI,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BAA+B,CAAC,CAAC;QAEnF,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,GAAG,MAAM,SAAS,CAAC;QAErD,MAAM,OAAO,GAAG,aAAa,CAAC,cAAc,CAAC,IAAiB,CAAC;QAC/D,MAAM,QAAQ,GAAuB,MAAM,IAAA,eAAO,EAAC,OAAO,EAAE,SAAS,CAAC,CAAC;QACvE,eAAM,CAAC,WAAW,CAAC,QAAQ,EAAE,WAAW,EAAE,qCAAqC,CAAC,CAAC;IACrF,CAAC,CAAC,CAAC;IAEH;;;;OAIG;IACH,EAAE,CAAC,mCAAmC,EAAE,KAAK,IAAI,EAAE;QAC/C,MAAM,SAAS,GAAG,MAAM,CAAC,aAAa,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;QAC9D,MAAM,OAAO,GAAG,CAAC,KAAY,EAAW,EAAE;YACtC,eAAM,CAAC,cAAc,CAAC,KAAK,CAAC,OAAO,EAAE,SAAS,EAAE,iCAAiC,CAAC,CAAC;YACnF,eAAM,CAAC,WAAW,CACd,KAAK,CAAC,OAAO,EACb,+DAA+D,EAC/D,qBAAqB,KAAK,CAAC,OAAO,EAAE,CACvC,CAAC;YACF,OAAO,IAAI,CAAC;QAChB,CAAC,CAAC;QAEF,MAAM,eAAM,CAAC,OAAO,CAAC,SAAS,EAAE,OAAO,EAAE,0CAA0C,CAAC,CAAC;IACzF,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport { strict as assert } from \"assert\";\nimport { AttachState } from \"@fluidframework/container-definitions\";\nimport { ContainerSchema } from \"@fluidframework/fluid-static\";\nimport { SharedMap } from \"@fluidframework/map\";\nimport { timeoutPromise } from \"@fluidframework/test-utils\";\nimport { AzureClient } from \"@fluidframework/azure-client\";\nimport { createAzureClient } from \"./AzureClientFactory\";\nimport { mapWait } from \"./utils\";\n\ndescribe(\"Container copy scenarios\", () => {\n const connectTimeoutMs = 1000;\n let client: AzureClient;\n let schema: ContainerSchema;\n\n beforeEach(() => {\n client = createAzureClient();\n schema = {\n initialObjects: {\n map1: SharedMap,\n },\n };\n });\n\n beforeEach(async function () {\n if (process.env.FLUID_CLIENT !== \"azure\") {\n this.skip();\n }\n });\n\n /**\n * Scenario: test if Azure Client can provide versions of the container.\n *\n * Expected behavior: an error should not be thrown nor should a rejected promise\n * be returned. Upon creation, we should recieve back 1 version of the container.\n */\n it(\"can get versions of current document\", async () => {\n const { container } = await client.createContainer(schema);\n const containerId = await container.attach();\n\n await timeoutPromise((resolve) => container.once(\"connected\", () => resolve()), {\n durationMs: connectTimeoutMs,\n errorMsg: \"container connect() timeout\",\n });\n const resources = client.getContainerVersions(containerId);\n await assert.doesNotReject(\n resources,\n () => true,\n \"could not get versions of the container\",\n );\n\n const versions = await resources;\n assert.strictEqual(versions.length, 1, \"Container should have exactly one version.\");\n });\n\n /**\n * Scenario: test if Azure Client can handle bad document ID when versions are requested.\n *\n * Expected behavior: Client should throw an error.\n */\n it(\"can handle bad document id when requesting versions\", async () => {\n const resources = client.getContainerVersions(\"badid\");\n const errorFn = (error: Error): boolean => {\n assert.notStrictEqual(error.message, undefined, \"Azure Client error is undefined\");\n assert.strictEqual(\n error.message,\n \"R11s fetch error: Document is deleted and cannot be accessed.\",\n `Unexpected error: ${error.message}`,\n );\n return true;\n };\n await assert.rejects(\n resources,\n errorFn,\n \"We should not be able to get container versions.\",\n );\n });\n\n /**\n * Scenario: test if Azure Client can copy existing container.\n *\n * Expected behavior: an error should not be thrown nor should a rejected promise\n * be returned.\n */\n it(\"can copy document successfully\", async () => {\n const { container } = await client.createContainer(schema);\n const containerId = await container.attach();\n\n await timeoutPromise((resolve) => container.once(\"connected\", () => resolve()), {\n durationMs: connectTimeoutMs,\n errorMsg: \"container connect() timeout\",\n });\n const resources = client.copyContainer(containerId, schema);\n await assert.doesNotReject(resources, () => true, \"container could not be copied\");\n\n const { container: containerCopy } = await resources;\n\n const newContainerId = await containerCopy.attach();\n await timeoutPromise((resolve) => containerCopy.once(\"connected\", () => resolve()), {\n durationMs: connectTimeoutMs,\n errorMsg: \"container connect() timeout\",\n });\n\n assert.strictEqual(typeof newContainerId, \"string\", \"Attach did not return a string ID\");\n assert.strictEqual(\n containerCopy.attachState,\n AttachState.Attached,\n \"Container is not attached after attach is called\",\n );\n });\n\n /**\n * Scenario: test if Azure Client can copy existing container at specific version.\n *\n * Expected behavior: an error should not be thrown nor should a rejected promise\n * be returned.\n */\n it(\"can sucesfully copy document from a specific version\", async () => {\n const { container } = await client.createContainer(schema);\n const containerId = await container.attach();\n\n await timeoutPromise((resolve) => container.once(\"connected\", () => resolve()), {\n durationMs: connectTimeoutMs,\n errorMsg: \"container connect() timeout\",\n });\n\n const versions = await client.getContainerVersions(containerId);\n assert.strictEqual(versions.length, 1, \"Container should have exactly one version.\");\n\n const resources = client.copyContainer(containerId, schema, versions[0]);\n await assert.doesNotReject(resources, () => true, \"container could not be copied\");\n\n const { container: containerCopy } = await resources;\n\n const newContainerId = await containerCopy.attach();\n await timeoutPromise((resolve) => containerCopy.once(\"connected\", () => resolve()), {\n durationMs: connectTimeoutMs,\n errorMsg: \"container connect() timeout\",\n });\n\n assert.strictEqual(typeof newContainerId, \"string\", \"Attach did not return a string ID\");\n assert.strictEqual(\n containerCopy.attachState,\n AttachState.Attached,\n \"Container is not attached after attach is called\",\n );\n });\n\n /**\n * Scenario: test if Azure Client properly handles DDS objects when\n * copying existing container.\n *\n * Expected behavior: DDS values should match across original and copied\n * container.\n */\n it(\"correctly copies DDS values when copying container\", async () => {\n const { container } = await client.createContainer(schema);\n\n const initialObjectsCreate = container.initialObjects;\n const map1Create = initialObjectsCreate.map1 as SharedMap;\n map1Create.set(\"new-key\", \"new-value\");\n const valueCreate: string | undefined = map1Create.get(\"new-key\");\n\n const containerId = await container.attach();\n\n await timeoutPromise((resolve) => container.once(\"connected\", () => resolve()), {\n durationMs: connectTimeoutMs,\n errorMsg: \"container connect() timeout\",\n });\n\n const resources = client.copyContainer(containerId, schema);\n await assert.doesNotReject(resources, () => true, \"container could not be copied\");\n\n const { container: containerCopy } = await resources;\n\n const map1Get = containerCopy.initialObjects.map1 as SharedMap;\n const valueGet: string | undefined = await mapWait(map1Get, \"new-key\");\n assert.strictEqual(valueGet, valueCreate, \"DDS value was not correctly copied.\");\n });\n\n /**\n * Scenario: test if Azure Client can handle non-existing container when trying to copy\n *\n * Expected behavior: client should throw an error.\n */\n it(\"can handle non-existing container\", async () => {\n const resources = client.copyContainer(\"badidoncopy\", schema);\n const errorFn = (error: Error): boolean => {\n assert.notStrictEqual(error.message, undefined, \"Azure Client error is undefined\");\n assert.strictEqual(\n error.message,\n \"R11s fetch error: Document is deleted and cannot be accessed.\",\n `Unexpected error: ${error.message}`,\n );\n return true;\n };\n\n await assert.rejects(resources, errorFn, \"We should not be able to copy container.\");\n });\n});\n"]}
@@ -21,17 +21,6 @@ describe("Container create scenarios", () => {
21
21
  },
22
22
  };
23
23
  });
24
- /**
25
- * Scenario: test when Azure Client is instantiated correctly, it can create
26
- * a container successfully.
27
- *
28
- * Expected behavior: an error should not be thrown nor should a rejected promise
29
- * be returned.
30
- */
31
- it("can create new Azure Fluid Relay container successfully", async () => {
32
- const resourcesP = client.createContainer(schema);
33
- await assert_1.strict.doesNotReject(resourcesP, () => true, "container cannot be created in Azure Fluid Relay");
34
- });
35
24
  /**
36
25
  * Scenario: test when an Azure Client container is created,
37
26
  * it is initially detached.
@@ -42,6 +31,9 @@ describe("Container create scenarios", () => {
42
31
  it("Created container is detached", async () => {
43
32
  const { container } = await client.createContainer(schema);
44
33
  assert_1.strict.strictEqual(container.attachState, container_definitions_1.AttachState.Detached, "Container should be detached");
34
+ // Make sure we can attach.
35
+ const containerId = await container.attach();
36
+ assert_1.strict.strictEqual(typeof containerId, "string", "Attach did not return a string ID");
45
37
  });
46
38
  /**
47
39
  * Scenario: Test attaching a container.
@@ -103,6 +95,7 @@ describe("Container create scenarios", () => {
103
95
  const containerAndServicesP = client.getContainer("containerConfig", schema);
104
96
  const errorFn = (error) => {
105
97
  assert_1.strict.notStrictEqual(error.message, undefined, "Azure Client error is undefined");
98
+ assert_1.strict.strictEqual(error.message, "R11s fetch error: Document is deleted and cannot be accessed.", `Unexpected error: ${error.message}`);
106
99
  return true;
107
100
  };
108
101
  await assert_1.strict.rejects(containerAndServicesP, errorFn, "Azure Client can load a non-existent container");
@@ -1 +1 @@
1
- {"version":3,"file":"containerCreate.spec.js","sourceRoot":"","sources":["../../src/test/containerCreate.spec.ts"],"names":[],"mappings":";;AAAA;;;GAGG;AACH,mCAA0C;AAC1C,iFAAoE;AAEpE,6CAAgD;AAChD,2DAA4D;AAE5D,6DAAyD;AAEzD,QAAQ,CAAC,4BAA4B,EAAE,GAAG,EAAE;IACxC,MAAM,gBAAgB,GAAG,IAAI,CAAC;IAC9B,IAAI,MAAmB,CAAC;IACxB,IAAI,MAAuB,CAAC;IAE5B,UAAU,CAAC,GAAG,EAAE;QACZ,MAAM,GAAG,IAAA,sCAAiB,GAAE,CAAC;QAC7B,MAAM,GAAG;YACL,cAAc,EAAE;gBACZ,IAAI,EAAE,eAAS;aAClB;SACJ,CAAC;IACN,CAAC,CAAC,CAAC;IAEH;;;;;;OAMG;IACH,EAAE,CAAC,yDAAyD,EAAE,KAAK,IAAI,EAAE;QACrE,MAAM,UAAU,GAAG,MAAM,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;QAElD,MAAM,eAAM,CAAC,aAAa,CACtB,UAAU,EACV,GAAG,EAAE,CAAC,IAAI,EACV,kDAAkD,CACrD,CAAC;IACN,CAAC,CAAC,CAAC;IAEH;;;;;;OAMG;IACH,EAAE,CAAC,+BAA+B,EAAE,KAAK,IAAI,EAAE;QAC3C,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,MAAM,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;QAC3D,eAAM,CAAC,WAAW,CACd,SAAS,CAAC,WAAW,EACrB,mCAAW,C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iC,CAAC,CAAC;YACnF,OAAO,IAAI,CAAC;QAChB,CAAC,CAAC;QAEF,MAAM,eAAM,CAAC,OAAO,CAChB,qBAAqB,EACrB,OAAO,EACP,gDAAgD,CACnD,CAAC;QACF,OAAO,CAAC,KAAK,GAAG,cAAc,CAAC;IACnC,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport { strict as assert } from \"assert\";\nimport { AttachState } from \"@fluidframework/container-definitions\";\nimport { ContainerSchema } from \"@fluidframework/fluid-static\";\nimport { SharedMap } from \"@fluidframework/map\";\nimport { timeoutPromise } from \"@fluidframework/test-utils\";\nimport { AzureClient } from \"@fluidframework/azure-client\";\nimport { createAzureClient } from \"./AzureClientFactory\";\n\ndescribe(\"Container create scenarios\", () => {\n const connectTimeoutMs = 1000;\n let client: AzureClient;\n let schema: ContainerSchema;\n\n beforeEach(() => {\n client = createAzureClient();\n schema = {\n initialObjects: {\n map1: SharedMap,\n },\n };\n });\n\n /**\n * Scenario: test when Azure Client is instantiated correctly, it can create\n * a container successfully.\n *\n * Expected behavior: an error should not be thrown nor should a rejected promise\n * be returned.\n */\n it(\"can create new Azure Fluid Relay container successfully\", async () => {\n const resourcesP = client.createContainer(schema);\n\n await assert.doesNotReject(\n resourcesP,\n () => true,\n \"container cannot be created in Azure Fluid Relay\",\n );\n });\n\n /**\n * Scenario: test when an Azure Client container is created,\n * it is initially detached.\n *\n * Expected behavior: an error should not be thrown nor should a rejected promise\n * be returned.\n */\n it(\"Created container is detached\", async () => {\n const { container } = await client.createContainer(schema);\n assert.strictEqual(\n container.attachState,\n AttachState.Detached,\n \"Container should be detached\",\n );\n });\n\n /**\n * Scenario: Test attaching a container.\n *\n * Expected behavior: an error should not be thrown nor should a rejected promise\n * be returned.\n */\n it(\"can attach a container\", async () => {\n const { container } = await client.createContainer(schema);\n const containerId = await container.attach();\n\n await timeoutPromise((resolve) => container.once(\"connected\", () => resolve()), {\n durationMs: connectTimeoutMs,\n errorMsg: \"container connect() timeout\",\n });\n\n assert.strictEqual(typeof containerId, \"string\", \"Attach did not return a string ID\");\n assert.strictEqual(\n container.attachState,\n AttachState.Attached,\n \"Container is not attached after attach is called\",\n );\n });\n\n /**\n * Scenario: Test if attaching a container twice fails.\n *\n * Expected behavior: an error should not be thrown nor should a rejected promise\n * be returned.\n */\n it(\"cannot attach a container twice\", async () => {\n const { container } = await client.createContainer(schema);\n const containerId = await container.attach();\n\n await timeoutPromise((resolve) => container.once(\"connected\", () => resolve()), {\n durationMs: connectTimeoutMs,\n errorMsg: \"container connect() timeout\",\n });\n\n assert.strictEqual(typeof containerId, \"string\", \"Attach did not return a string ID\");\n assert.strictEqual(\n container.attachState,\n AttachState.Attached,\n \"Container is attached after attach is called\",\n );\n await assert.rejects(container.attach(), () => true, \"Container should not attach twice\");\n });\n\n /**\n * Scenario: test if Azure Client can get an existing container.\n *\n * Expected behavior: an error should not be thrown nor should a rejected promise\n * be returned.\n */\n it(\"can retrieve existing Azure Fluid Relay container successfully\", async () => {\n const { container: newContainer } = await client.createContainer(schema);\n const containerId = await newContainer.attach();\n\n await timeoutPromise((resolve) => newContainer.once(\"connected\", () => resolve()), {\n durationMs: connectTimeoutMs,\n errorMsg: \"container connect() timeout\",\n });\n\n const resources = client.getContainer(containerId, schema);\n await assert.doesNotReject(\n resources,\n () => true,\n \"container cannot be retrieved from Azure Fluid Relay\",\n );\n });\n\n /**\n * Scenario: test if Azure Client can get a non-exiting container.\n *\n * Expected behavior: an error should be thrown when trying to get a non-existent container.\n */\n it(\"cannot load improperly created container (cannot load a non-existent container)\", async () => {\n const consoleErrorFn = console.error;\n console.error = (): void => {};\n const containerAndServicesP = client.getContainer(\"containerConfig\", schema);\n\n const errorFn = (error: Error): boolean => {\n assert.notStrictEqual(error.message, undefined, \"Azure Client error is undefined\");\n return true;\n };\n\n await assert.rejects(\n containerAndServicesP,\n errorFn,\n \"Azure Client can load a non-existent container\",\n );\n console.error = consoleErrorFn;\n });\n});\n"]}
1
+ {"version":3,"file":"containerCreate.spec.js","sourceRoot":"","sources":["../../src/test/containerCreate.spec.ts"],"names":[],"mappings":";;AAAA;;;GAGG;AACH,mCAA0C;AAG1C,iFAAoE;AAEpE,6CAAgD;AAChD,2DAA4D;AAE5D,6DAAyD;AAEzD,QAAQ,CAAC,4BAA4B,EAAE,GAAG,EAAE;IACxC,MAAM,gBAAgB,GAAG,IAAI,CAAC;IAC9B,IAAI,MAAmB,CAAC;IACxB,IAAI,MAAuB,CAAC;IAE5B,UAAU,CAAC,GAAG,EAAE;QACZ,MAAM,GAAG,IAAA,sCAAiB,GAAE,CAAC;QAC7B,MAAM,GAAG;YACL,cAAc,EAAE;gBACZ,IAAI,EAAE,eAAS;aAClB;SACJ,CAAC;IACN,CAAC,CAAC,CAAC;IAEH;;;;;;OAMG;IACH,EAAE,CAAC,+BAA+B,EAAE,KAAK,IAAI,EAAE;QAC3C,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,MAAM,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;QAC3D,eAAM,CAAC,WAAW,CACd,SAAS,CAAC,WAAW,EACrB,mCAAW,CAAC,QAAQ,EACpB,8BAA8B,CACjC,CAAC;QAEF,2BAA2B;QAC3B,MAAM,WAAW,GAAG,MAAM,SAAS,CAAC,MAAM,EAAE,CAAC;QAC7C,eAAM,CAAC,WAAW,CAAC,OAAO,WAAW,EAAE,QAAQ,EAAE,mCAAmC,CAAC,CAAC;IAC1F,CAAC,CAAC,CAAC;IAEH;;;;;OAKG;IACH,EAAE,CAAC,wBAAwB,EAAE,KAAK,IAAI,EAAE;QACpC,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,MAAM,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;QAC3D,MAAM,WAAW,GAAG,MAAM,SAAS,CAAC,MAAM,EAAE,CAAC;QAE7C,MAAM,IAAA,2BAAc,EAAC,CAAC,OAA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AACP,CAAC,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport { strict as assert } from \"assert\";\n\nimport { AzureClient } from \"@fluidframework/azure-client\";\nimport { AttachState } from \"@fluidframework/container-definitions\";\nimport { ContainerSchema } from \"@fluidframework/fluid-static\";\nimport { SharedMap } from \"@fluidframework/map\";\nimport { timeoutPromise } from \"@fluidframework/test-utils\";\n\nimport { createAzureClient } from \"./AzureClientFactory\";\n\ndescribe(\"Container create scenarios\", () => {\n const connectTimeoutMs = 1000;\n let client: AzureClient;\n let schema: ContainerSchema;\n\n beforeEach(() => {\n client = createAzureClient();\n schema = {\n initialObjects: {\n map1: SharedMap,\n },\n };\n });\n\n /**\n * Scenario: test when an Azure Client container is created,\n * it is initially detached.\n *\n * Expected behavior: an error should not be thrown nor should a rejected promise\n * be returned.\n */\n it(\"Created container is detached\", async () => {\n const { container } = await client.createContainer(schema);\n assert.strictEqual(\n container.attachState,\n AttachState.Detached,\n \"Container should be detached\",\n );\n\n // Make sure we can attach.\n const containerId = await container.attach();\n assert.strictEqual(typeof containerId, \"string\", \"Attach did not return a string ID\");\n });\n\n /**\n * Scenario: Test attaching a container.\n *\n * Expected behavior: an error should not be thrown nor should a rejected promise\n * be returned.\n */\n it(\"can attach a container\", async () => {\n const { container } = await client.createContainer(schema);\n const containerId = await container.attach();\n\n await timeoutPromise((resolve) => container.once(\"connected\", () => resolve()), {\n durationMs: connectTimeoutMs,\n errorMsg: \"container connect() timeout\",\n });\n\n assert.strictEqual(typeof containerId, \"string\", \"Attach did not return a string ID\");\n assert.strictEqual(\n container.attachState,\n AttachState.Attached,\n \"Container is not attached after attach is called\",\n );\n });\n\n /**\n * Scenario: Test if attaching a container twice fails.\n *\n * Expected behavior: an error should not be thrown nor should a rejected promise\n * be returned.\n */\n it(\"cannot attach a container twice\", async () => {\n const { container } = await client.createContainer(schema);\n const containerId = await container.attach();\n\n await timeoutPromise((resolve) => container.once(\"connected\", () => resolve()), {\n durationMs: connectTimeoutMs,\n errorMsg: \"container connect() timeout\",\n });\n\n assert.strictEqual(typeof containerId, \"string\", \"Attach did not return a string ID\");\n assert.strictEqual(\n container.attachState,\n AttachState.Attached,\n \"Container is attached after attach is called\",\n );\n await assert.rejects(container.attach(), () => true, \"Container should not attach twice\");\n });\n\n /**\n * Scenario: test if Azure Client can get an existing container.\n *\n * Expected behavior: an error should not be thrown nor should a rejected promise\n * be returned.\n */\n it(\"can retrieve existing Azure Fluid Relay container successfully\", async () => {\n const { container: newContainer } = await client.createContainer(schema);\n const containerId = await newContainer.attach();\n\n await timeoutPromise((resolve) => newContainer.once(\"connected\", () => resolve()), {\n durationMs: connectTimeoutMs,\n errorMsg: \"container connect() timeout\",\n });\n\n const resources = client.getContainer(containerId, schema);\n await assert.doesNotReject(\n resources,\n () => true,\n \"container cannot be retrieved from Azure Fluid Relay\",\n );\n });\n\n /**\n * Scenario: test if Azure Client can get a non-exiting container.\n *\n * Expected behavior: an error should be thrown when trying to get a non-existent container.\n */\n it(\"cannot load improperly created container (cannot load a non-existent container)\", async () => {\n const consoleErrorFn = console.error;\n console.error = (): void => {};\n const containerAndServicesP = client.getContainer(\"containerConfig\", schema);\n\n const errorFn = (error: Error): boolean => {\n assert.notStrictEqual(error.message, undefined, \"Azure Client error is undefined\");\n assert.strictEqual(\n error.message,\n \"R11s fetch error: Document is deleted and cannot be accessed.\",\n `Unexpected error: ${error.message}`,\n );\n return true;\n };\n\n await assert.rejects(\n containerAndServicesP,\n errorFn,\n \"Azure Client can load a non-existent container\",\n );\n console.error = consoleErrorFn;\n });\n});\n"]}
@@ -168,6 +168,7 @@ describe("Fluid data updates", () => {
168
168
  dynamicObjectTypes: [TestDataObject_1.TestDataObject],
169
169
  };
170
170
  const { container } = await client.createContainer(dynamicSchema);
171
+ await container.attach();
171
172
  const newDo = await container.create(TestDataObject_1.TestDataObject);
172
173
  assert_1.strict.ok(newDo === null || newDo === void 0 ? void 0 : newDo.handle);
173
174
  const map1 = container.initialObjects.map1;
@@ -1 +1 @@
1
- {"version":3,"file":"ddsTests.spec.js","sourceRoot":"","sources":["../../src/test/ddsTests.spec.ts"],"names":[],"mappings":";;AAAA;;;GAGG;AACH,mCAA0C;AAG1C,6CAAgD;AAChD,2DAA4D;AAE5D,6DAAyD;AACzD,qDAAyE;AACzE,mCAAkC;AAElC,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;IAChC,MAAM,gBAAgB,GAAG,IAAI,CAAC;IAC9B,IAAI,MAAmB,CAAC;IACxB,IAAI,MAAuB,CAAC;IAE5B,UAAU,CAAC,GAAG,EAAE;QACZ,MAAM,GAAG,IAAA,sCAAiB,GAAE,CAAC;QAC7B,MAAM,GAAG;YACL,cAAc,EAAE;gBACZ,IAAI,EAAE,eAAS;aAClB;SACJ,CAAC;IACN,CAAC,CAAC,CAAC;IAEH;;;;;;OAMG;IACH,EAAE,CAAC,kDAAkD,EAAE,KAAK,IAAI,EAAE;QAC9D,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,GAAG,MAAM,MAAM,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;QACzE,MAAM,WAAW,GAAG,MAAM,YAAY,CAAC,MAAM,EAAE,CAAC;QAEhD,MAAM,IAAA,2BAAc,EAAC,CAAC,OAAO,EAAE,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,WAAW,EAAE,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC,EAAE;YAC/E,UAAU,EAAE,gBAAgB;YAC5B,QAAQ,EAAE,6BAA6B;SAC1C,CAAC,CAAC;QAEH,MAAM,SAAS,GAAG,MAAM,CAAC,YAAY,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;QAC3D,MAAM,eAAM,CAAC,aAAa,CACtB,SAAS,EACT,GAAG,EAAE,CAAC,IAAI,EACV,sDAAsD,CACzD,CAAC;QAEF,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,SAAS,CAAC;QACtC,eAAM,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iFAAiF,EAAE,KAAK,IAAI,EAAE;QAC7F,MAAM,aAAa,GAAoB;YACnC,cAAc,EAAE;gBACZ,IAAI,EAAE,eAAS;aAClB;YACD,kBAAkB,EAAE,CAAC,+BAAc,CAAC;SACvC,CAAC;QAEF,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,MAAM,CAAC,eAAe,CAAC,aAAa,CAAC,CAAC;QAElE,MAAM,KAAK,GAAG,MAAM,SAAS,CAAC,MAAM,CAAC,+BAAc,CAAC,CAAC;QACrD,eAAM,CAAC,EAAE,CAAC,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,MAAM,CAAC,CAAC;QAEzB,MAAM,IAAI,GAAG,SAAS,CAAC,cAAc,CAAC,IAAiB,CAAC;QACxD,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;QACtC,MAAM,MAAM,GAA6B,MAAM,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;QACvE,MAAM,GAAG,GAAY,MAAM,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,GAAG,EAAE,CAAA,CAAC;QACzC,eAAM,CAAC,EAAE,CAAC,GAAG,EAAE,6CAA6C,CAAC,CAAC;IAClE,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport { strict as assert } from \"assert\";\nimport { IFluidHandle } from \"@fluidframework/core-interfaces\";\nimport { ContainerSchema } from \"@fluidframework/fluid-static\";\nimport { SharedMap } from \"@fluidframework/map\";\nimport { timeoutPromise } from \"@fluidframework/test-utils\";\nimport { AzureClient } from \"@fluidframework/azure-client\";\nimport { createAzureClient } from \"./AzureClientFactory\";\nimport { TestDataObject, CounterTestDataObject } from \"./TestDataObject\";\nimport { mapWait } from \"./utils\";\n\ndescribe(\"Fluid data updates\", () => {\n const connectTimeoutMs = 1000;\n let client: AzureClient;\n let schema: ContainerSchema;\n\n beforeEach(() => {\n client = createAzureClient();\n schema = {\n initialObjects: {\n map1: SharedMap,\n },\n };\n });\n\n /**\n * Scenario: test when an Azure Client container is created,\n * it can set the initial objects.\n *\n * Expected behavior: an error should not be thrown nor should a rejected promise\n * be returned.\n */\n it(\"can set DDSes as initial objects for a container\", async () => {\n const { container: newContainer } = await client.createContainer(schema);\n const containerId = await newContainer.attach();\n\n await timeoutPromise((resolve) => newContainer.once(\"connected\", () => resolve()), {\n durationMs: connectTimeoutMs,\n errorMsg: \"container connect() timeout\",\n });\n\n const resources = client.getContainer(containerId, schema);\n await assert.doesNotReject(\n resources,\n () => true,\n \"container cannot be retrieved from Azure Fluid Relay\",\n );\n\n const { container } = await resources;\n assert.deepStrictEqual(\n Object.keys(container.initialObjects),\n Object.keys(schema.initialObjects),\n );\n });\n\n /**\n * Scenario: test if initialObjects passed into the container functions correctly.\n *\n * Expected behavior: initialObjects value loaded in two different containers should mirror\n * each other after value is changed.\n */\n it(\"can change DDSes within initialObjects value\", async () => {\n const { container } = await client.createContainer(schema);\n const containerId = await container.attach();\n\n await timeoutPromise((resolve) => container.once(\"connected\", () => resolve()), {\n durationMs: connectTimeoutMs,\n errorMsg: \"container connect() timeout\",\n });\n\n const initialObjectsCreate = container.initialObjects;\n const map1Create = initialObjectsCreate.map1 as SharedMap;\n map1Create.set(\"new-key\", \"new-value\");\n const valueCreate: string | undefined = map1Create.get(\"new-key\");\n\n const { container: containerGet } = await client.getContainer(containerId, schema);\n const map1Get = containerGet.initialObjects.map1 as SharedMap;\n const valueGet: string | undefined = await mapWait(map1Get, \"new-key\");\n assert.strictEqual(valueGet, valueCreate, \"container can't change initial objects\");\n });\n\n /**\n * Scenario: test if we can create DataObjects through initialObjects schema.\n *\n * Expected behavior: DataObjects can be retrieved from the original and loaded container.\n */\n it(\"can set DataObjects as initial objects for a container\", async () => {\n const doSchema: ContainerSchema = {\n initialObjects: {\n mdo1: TestDataObject,\n mdo2: CounterTestDataObject,\n },\n };\n const { container } = await client.createContainer(doSchema);\n const containerId = await container.attach();\n\n await timeoutPromise((resolve) => container.once(\"connected\", () => resolve()), {\n durationMs: connectTimeoutMs,\n errorMsg: \"container connect() timeout\",\n });\n\n const initialObjectsCreate = container.initialObjects;\n assert(\n initialObjectsCreate.mdo1 instanceof TestDataObject,\n \"container returns the wrong type for mdo1\",\n );\n assert(\n initialObjectsCreate.mdo2 instanceof CounterTestDataObject,\n \"container returns the wrong type for mdo2\",\n );\n\n const { container: containerGet } = await client.getContainer(containerId, doSchema);\n const initialObjectsGet = containerGet.initialObjects;\n assert(\n initialObjectsGet.mdo1 instanceof TestDataObject,\n \"container returns the wrong type for mdo1\",\n );\n assert(\n initialObjectsCreate.mdo2 instanceof CounterTestDataObject,\n \"container returns the wrong type for mdo2\",\n );\n });\n\n /**\n * Scenario: test if we can create multiple DataObjects of the same type\n *\n * Expected behavior: DataObjects of the same type can be retrieved from the\n * original and loaded container.\n * TODO: Known bug that needs to be re-tested once fixed.\n */\n it(\"can use multiple DataObjects of the same type\", async () => {\n const doSchema: ContainerSchema = {\n initialObjects: {\n mdo1: TestDataObject,\n mdo2: CounterTestDataObject,\n mdo3: CounterTestDataObject,\n },\n };\n const { container } = await client.createContainer(doSchema);\n const containerId = await container.attach();\n\n await timeoutPromise((resolve) => container.once(\"connected\", () => resolve()), {\n durationMs: connectTimeoutMs,\n errorMsg: \"container connect() timeout\",\n });\n\n const initialObjectsCreate = container.initialObjects;\n assert(\n initialObjectsCreate.mdo1 instanceof TestDataObject,\n \"container returns the wrong type for mdo1\",\n );\n assert(\n initialObjectsCreate.mdo2 instanceof CounterTestDataObject,\n \"container returns the wrong type for mdo2\",\n );\n assert(\n initialObjectsCreate.mdo3 instanceof CounterTestDataObject,\n \"container returns the wrong type for mdo3\",\n );\n\n const { container: containerGet } = await client.getContainer(containerId, doSchema);\n const initialObjectsGet = containerGet.initialObjects;\n assert(\n initialObjectsGet.mdo1 instanceof TestDataObject,\n \"container returns the wrong type for mdo1\",\n );\n assert(\n initialObjectsCreate.mdo2 instanceof CounterTestDataObject,\n \"container returns the wrong type for mdo2\",\n );\n assert(\n initialObjectsCreate.mdo3 instanceof CounterTestDataObject,\n \"container returns the wrong type for mdo3\",\n );\n });\n\n /**\n * Scenario: test if we can change DataObject value contained within initialObjects\n *\n * Expected behavior: DataObject changes are correctly reflected on original and loaded containers\n */\n it(\"can change DataObjects within initialObjects value\", async () => {\n const doSchema: ContainerSchema = {\n initialObjects: {\n mdo1: TestDataObject,\n mdo2: CounterTestDataObject,\n },\n };\n const { container } = await client.createContainer(doSchema);\n const initialObjectsCreate = container.initialObjects;\n const mdo2 = initialObjectsCreate.mdo2 as CounterTestDataObject;\n mdo2.increment();\n mdo2.increment();\n mdo2.increment();\n\n assert.strictEqual(mdo2.value, 3);\n\n const containerId = await container.attach();\n\n await timeoutPromise((resolve) => container.once(\"connected\", () => resolve()), {\n durationMs: connectTimeoutMs,\n errorMsg: \"container connect() timeout\",\n });\n\n const { container: containerGet } = await client.getContainer(containerId, doSchema);\n const initialObjectsGet = containerGet.initialObjects;\n const mdo2get = initialObjectsGet.mdo2 as CounterTestDataObject;\n\n assert.strictEqual(mdo2get.value, 3);\n\n mdo2get.increment();\n mdo2get.increment();\n assert.strictEqual(mdo2get.value, 5);\n });\n\n /**\n * Scenario: test if the optional schema parameter, dynamicObjectTypes (custom data objects),\n * can be added during runtime and be returned by the container.\n *\n * Expected behavior: added loadable object can be retrieved from the container. Loadable\n * object's id and container config ID should be identical since it's now attached to\n * the container.\n */\n it(\"can create/add loadable objects (custom data object) dynamically during runtime\", async () => {\n const dynamicSchema: ContainerSchema = {\n initialObjects: {\n map1: SharedMap,\n },\n dynamicObjectTypes: [TestDataObject],\n };\n\n const { container } = await client.createContainer(dynamicSchema);\n\n const newDo = await container.create(TestDataObject);\n assert.ok(newDo?.handle);\n\n const map1 = container.initialObjects.map1 as SharedMap;\n map1.set(\"new-pair-id\", newDo.handle);\n const handle: IFluidHandle | undefined = await map1.get(\"new-pair-id\");\n const obj: unknown = await handle?.get();\n assert.ok(obj, \"container added dynamic objects incorrectly\");\n });\n});\n"]}
1
+ {"version":3,"file":"ddsTests.spec.js","sourceRoot":"","sources":["../../src/test/ddsTests.spec.ts"],"names":[],"mappings":";;AAAA;;;GAGG;AACH,mCAA0C;AAG1C,6CAAgD;AAChD,2DAA4D;AAE5D,6DAAyD;AACzD,qDAAyE;AACzE,mCAAkC;AAElC,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;IAChC,MAAM,gBAAgB,GAAG,IAAI,CAAC;IAC9B,IAAI,MAAmB,CAAC;IACxB,IAAI,MAAuB,CAAC;IAE5B,UAAU,CAAC,GAAG,EAAE;QACZ,MAAM,GAAG,IAAA,sCAAiB,GAAE,CAAC;QAC7B,MAAM,GAAG;YACL,cAAc,EAAE;gBACZ,IAAI,EAAE,eAAS;aAClB;SACJ,CAAC;IACN,CAAC,CAAC,CAAC;IAEH;;;;;;OAMG;IACH,EAAE,CAAC,kDAAkD,EAAE,KAAK,IAAI,EAAE;QAC9D,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,GAAG,MAAM,MAAM,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;QACzE,MAAM,WAAW,GAAG,MAAM,YAAY,CAAC,MAAM,EAAE,CAAC;QAEhD,MAAM,IAAA,2BAAc,EAAC,CAAC,OAAO,EAAE,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,WAAW,EAAE,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC,EAAE;YAC/E,UAAU,EAAE,gBAAgB;YAC5B,QAAQ,EAAE,6BAA6B;SAC1C,CAAC,CAAC;QAEH,MAAM,SAAS,GAAG,MAAM,CAAC,YAAY,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;QAC3D,MAAM,eAAM,CAAC,aAAa,CACtB,SAAS,EACT,GAAG,EAAE,CAAC,IAAI,EACV,sDAAsD,CACzD,CAAC;QAEF,MAAM,EAAE,SAAS,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CAAC;IAEH;;;;;;;OAOG;IACH,EAAE,CAAC,iFAAiF,EAAE,KAAK,IAAI,EAAE;QAC7F,MAAM,aAAa,GAAoB;YACnC,cAAc,EAAE;gBACZ,IAAI,EAAE,eAAS;aAClB;YACD,kBAAkB,EAAE,CAAC,+BAAc,CAAC;SACvC,CAAC;QAEF,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,MAAM,CAAC,eAAe,CAAC,aAAa,CAAC,CAAC;QAClE,MAAM,SAAS,CAAC,MAAM,EAAE,CAAC;QAEzB,MAAM,KAAK,GAAG,MAAM,SAAS,CAAC,MAAM,CAAC,+BAAc,CAAC,CAAC;QACrD,eAAM,CAAC,EAAE,CAAC,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,MAAM,CAAC,CAAC;QAEzB,MAAM,IAAI,GAAG,SAAS,CAAC,cAAc,CAAC,IAAiB,CAAC;QACxD,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;QACtC,MAAM,MAAM,GAA6B,MAAM,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;QACvE,MAAM,GAAG,GAAY,MAAM,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,GAAG,EAAE,CAAA,CAAC;QACzC,eAAM,CAAC,EAAE,CAAC,GAAG,EAAE,6CAA6C,CAAC,CAAC;IAClE,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport { strict as assert } from \"assert\";\nimport { IFluidHandle } from \"@fluidframework/core-interfaces\";\nimport { ContainerSchema } from \"@fluidframework/fluid-static\";\nimport { SharedMap } from \"@fluidframework/map\";\nimport { timeoutPromise } from \"@fluidframework/test-utils\";\nimport { AzureClient } from \"@fluidframework/azure-client\";\nimport { createAzureClient } from \"./AzureClientFactory\";\nimport { TestDataObject, CounterTestDataObject } from \"./TestDataObject\";\nimport { mapWait } from \"./utils\";\n\ndescribe(\"Fluid data updates\", () => {\n const connectTimeoutMs = 1000;\n let client: AzureClient;\n let schema: ContainerSchema;\n\n beforeEach(() => {\n client = createAzureClient();\n schema = {\n initialObjects: {\n map1: SharedMap,\n },\n };\n });\n\n /**\n * Scenario: test when an Azure Client container is created,\n * it can set the initial objects.\n *\n * Expected behavior: an error should not be thrown nor should a rejected promise\n * be returned.\n */\n it(\"can set DDSes as initial objects for a container\", async () => {\n const { container: newContainer } = await client.createContainer(schema);\n const containerId = await newContainer.attach();\n\n await timeoutPromise((resolve) => newContainer.once(\"connected\", () => resolve()), {\n durationMs: connectTimeoutMs,\n errorMsg: \"container connect() timeout\",\n });\n\n const resources = client.getContainer(containerId, schema);\n await assert.doesNotReject(\n resources,\n () => true,\n \"container cannot be retrieved from Azure Fluid Relay\",\n );\n\n const { container } = await resources;\n assert.deepStrictEqual(\n Object.keys(container.initialObjects),\n Object.keys(schema.initialObjects),\n );\n });\n\n /**\n * Scenario: test if initialObjects passed into the container functions correctly.\n *\n * Expected behavior: initialObjects value loaded in two different containers should mirror\n * each other after value is changed.\n */\n it(\"can change DDSes within initialObjects value\", async () => {\n const { container } = await client.createContainer(schema);\n const containerId = await container.attach();\n\n await timeoutPromise((resolve) => container.once(\"connected\", () => resolve()), {\n durationMs: connectTimeoutMs,\n errorMsg: \"container connect() timeout\",\n });\n\n const initialObjectsCreate = container.initialObjects;\n const map1Create = initialObjectsCreate.map1 as SharedMap;\n map1Create.set(\"new-key\", \"new-value\");\n const valueCreate: string | undefined = map1Create.get(\"new-key\");\n\n const { container: containerGet } = await client.getContainer(containerId, schema);\n const map1Get = containerGet.initialObjects.map1 as SharedMap;\n const valueGet: string | undefined = await mapWait(map1Get, \"new-key\");\n assert.strictEqual(valueGet, valueCreate, \"container can't change initial objects\");\n });\n\n /**\n * Scenario: test if we can create DataObjects through initialObjects schema.\n *\n * Expected behavior: DataObjects can be retrieved from the original and loaded container.\n */\n it(\"can set DataObjects as initial objects for a container\", async () => {\n const doSchema: ContainerSchema = {\n initialObjects: {\n mdo1: TestDataObject,\n mdo2: CounterTestDataObject,\n },\n };\n const { container } = await client.createContainer(doSchema);\n const containerId = await container.attach();\n\n await timeoutPromise((resolve) => container.once(\"connected\", () => resolve()), {\n durationMs: connectTimeoutMs,\n errorMsg: \"container connect() timeout\",\n });\n\n const initialObjectsCreate = container.initialObjects;\n assert(\n initialObjectsCreate.mdo1 instanceof TestDataObject,\n \"container returns the wrong type for mdo1\",\n );\n assert(\n initialObjectsCreate.mdo2 instanceof CounterTestDataObject,\n \"container returns the wrong type for mdo2\",\n );\n\n const { container: containerGet } = await client.getContainer(containerId, doSchema);\n const initialObjectsGet = containerGet.initialObjects;\n assert(\n initialObjectsGet.mdo1 instanceof TestDataObject,\n \"container returns the wrong type for mdo1\",\n );\n assert(\n initialObjectsCreate.mdo2 instanceof CounterTestDataObject,\n \"container returns the wrong type for mdo2\",\n );\n });\n\n /**\n * Scenario: test if we can create multiple DataObjects of the same type\n *\n * Expected behavior: DataObjects of the same type can be retrieved from the\n * original and loaded container.\n * TODO: Known bug that needs to be re-tested once fixed.\n */\n it(\"can use multiple DataObjects of the same type\", async () => {\n const doSchema: ContainerSchema = {\n initialObjects: {\n mdo1: TestDataObject,\n mdo2: CounterTestDataObject,\n mdo3: CounterTestDataObject,\n },\n };\n const { container } = await client.createContainer(doSchema);\n const containerId = await container.attach();\n\n await timeoutPromise((resolve) => container.once(\"connected\", () => resolve()), {\n durationMs: connectTimeoutMs,\n errorMsg: \"container connect() timeout\",\n });\n\n const initialObjectsCreate = container.initialObjects;\n assert(\n initialObjectsCreate.mdo1 instanceof TestDataObject,\n \"container returns the wrong type for mdo1\",\n );\n assert(\n initialObjectsCreate.mdo2 instanceof CounterTestDataObject,\n \"container returns the wrong type for mdo2\",\n );\n assert(\n initialObjectsCreate.mdo3 instanceof CounterTestDataObject,\n \"container returns the wrong type for mdo3\",\n );\n\n const { container: containerGet } = await client.getContainer(containerId, doSchema);\n const initialObjectsGet = containerGet.initialObjects;\n assert(\n initialObjectsGet.mdo1 instanceof TestDataObject,\n \"container returns the wrong type for mdo1\",\n );\n assert(\n initialObjectsCreate.mdo2 instanceof CounterTestDataObject,\n \"container returns the wrong type for mdo2\",\n );\n assert(\n initialObjectsCreate.mdo3 instanceof CounterTestDataObject,\n \"container returns the wrong type for mdo3\",\n );\n });\n\n /**\n * Scenario: test if we can change DataObject value contained within initialObjects\n *\n * Expected behavior: DataObject changes are correctly reflected on original and loaded containers\n */\n it(\"can change DataObjects within initialObjects value\", async () => {\n const doSchema: ContainerSchema = {\n initialObjects: {\n mdo1: TestDataObject,\n mdo2: CounterTestDataObject,\n },\n };\n const { container } = await client.createContainer(doSchema);\n const initialObjectsCreate = container.initialObjects;\n const mdo2 = initialObjectsCreate.mdo2 as CounterTestDataObject;\n mdo2.increment();\n mdo2.increment();\n mdo2.increment();\n\n assert.strictEqual(mdo2.value, 3);\n\n const containerId = await container.attach();\n\n await timeoutPromise((resolve) => container.once(\"connected\", () => resolve()), {\n durationMs: connectTimeoutMs,\n errorMsg: \"container connect() timeout\",\n });\n\n const { container: containerGet } = await client.getContainer(containerId, doSchema);\n const initialObjectsGet = containerGet.initialObjects;\n const mdo2get = initialObjectsGet.mdo2 as CounterTestDataObject;\n\n assert.strictEqual(mdo2get.value, 3);\n\n mdo2get.increment();\n mdo2get.increment();\n assert.strictEqual(mdo2get.value, 5);\n });\n\n /**\n * Scenario: test if the optional schema parameter, dynamicObjectTypes (custom data objects),\n * can be added during runtime and be returned by the container.\n *\n * Expected behavior: added loadable object can be retrieved from the container. Loadable\n * object's id and container config ID should be identical since it's now attached to\n * the container.\n */\n it(\"can create/add loadable objects (custom data object) dynamically during runtime\", async () => {\n const dynamicSchema: ContainerSchema = {\n initialObjects: {\n map1: SharedMap,\n },\n dynamicObjectTypes: [TestDataObject],\n };\n\n const { container } = await client.createContainer(dynamicSchema);\n await container.attach();\n\n const newDo = await container.create(TestDataObject);\n assert.ok(newDo?.handle);\n\n const map1 = container.initialObjects.map1 as SharedMap;\n map1.set(\"new-pair-id\", newDo.handle);\n const handle: IFluidHandle | undefined = await map1.get(\"new-pair-id\");\n const obj: unknown = await handle?.get();\n assert.ok(obj, \"container added dynamic objects incorrectly\");\n });\n});\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/azure-end-to-end-tests",
3
- "version": "1.2.0-106934",
3
+ "version": "1.2.0-111554",
4
4
  "description": "Azure client end to end tests",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -30,9 +30,7 @@
30
30
  "test:realsvc:azure:run": "mocha --unhandled-rejections=strict --recursive dist/test/**/*.spec.js --exit --timeout 10000",
31
31
  "test:realsvc:run": "mocha dist/test --config src/test/.mocharc.js",
32
32
  "test:realsvc:tinylicious": "start-server-and-test start:tinylicious:test 7071 test:realsvc:azure:run",
33
- "test:realsvc:verbose": "cross-env FLUID_TEST_VERBOSE=1 npm run test:realsvc",
34
- "tsfmt": "tsfmt --verify",
35
- "tsfmt:fix": "tsfmt --replace"
33
+ "test:realsvc:verbose": "cross-env FLUID_TEST_VERBOSE=1 npm run test:realsvc"
36
34
  },
37
35
  "nyc": {
38
36
  "all": true,
@@ -55,23 +53,23 @@
55
53
  "temp-directory": "nyc/.nyc_output"
56
54
  },
57
55
  "dependencies": {
58
- "@fluidframework/aqueduct": "^1.3.0",
59
- "@fluidframework/azure-client": "1.2.0-106934",
60
- "@fluidframework/container-definitions": "^1.3.0",
61
- "@fluidframework/core-interfaces": "^1.3.0",
62
- "@fluidframework/counter": "^1.3.0",
63
- "@fluidframework/fluid-static": "^1.3.0",
64
- "@fluidframework/map": "^1.3.0",
65
- "@fluidframework/matrix": "^1.3.0",
66
- "@fluidframework/mocha-test-setup": "^1.3.0",
67
- "@fluidframework/sequence": "^1.3.0",
56
+ "@fluidframework/aqueduct": "^1.4.0-108057",
57
+ "@fluidframework/azure-client": "1.2.0-111554",
58
+ "@fluidframework/container-definitions": "^1.4.0-108057",
59
+ "@fluidframework/core-interfaces": "^1.4.0-108057",
60
+ "@fluidframework/counter": "^1.4.0-108057",
61
+ "@fluidframework/fluid-static": "^1.4.0-108057",
62
+ "@fluidframework/map": "^1.4.0-108057",
63
+ "@fluidframework/matrix": "^1.4.0-108057",
64
+ "@fluidframework/mocha-test-setup": "^1.4.0-108057",
65
+ "@fluidframework/sequence": "^1.4.0-108057",
68
66
  "@fluidframework/server-services-client": "^0.1036.5000",
69
- "@fluidframework/telemetry-utils": "^1.3.0",
70
- "@fluidframework/test-client-utils": "1.4.0-106438",
71
- "@fluidframework/test-runtime-utils": "^1.3.0",
72
- "@fluidframework/test-utils": "^1.3.0",
67
+ "@fluidframework/telemetry-utils": "^1.4.0-108057",
68
+ "@fluidframework/test-client-utils": "1.4.0-108057",
69
+ "@fluidframework/test-runtime-utils": "^1.4.0-108057",
70
+ "@fluidframework/test-utils": "^1.4.0-108057",
73
71
  "cross-env": "^7.0.2",
74
- "fluid-framework": "^1.3.0",
72
+ "fluid-framework": "^1.4.0-108057",
75
73
  "mocha": "^10.0.0",
76
74
  "sinon": "^7.4.2",
77
75
  "start-server-and-test": "^1.11.7",
@@ -91,7 +89,6 @@
91
89
  "nock": "^10.0.1",
92
90
  "nyc": "^15.0.0",
93
91
  "rimraf": "^2.6.2",
94
- "typescript": "~4.5.5",
95
- "typescript-formatter": "7.1.0"
92
+ "typescript": "~4.5.5"
96
93
  }
97
94
  }
@@ -6,4 +6,4 @@
6
6
  */
7
7
 
8
8
  export const pkgName = "@fluidframework/azure-end-to-end-tests";
9
- export const pkgVersion = "1.2.0-106934";
9
+ export const pkgVersion = "1.2.0-111554";
@@ -57,15 +57,24 @@ describe("Container copy scenarios", () => {
57
57
  });
58
58
 
59
59
  /**
60
- * Scenario: test if Azure Client can handle bad version ID when versions are requested.
60
+ * Scenario: test if Azure Client can handle bad document ID when versions are requested.
61
61
  *
62
62
  * Expected behavior: Client should throw an error.
63
63
  */
64
- it("can handle bad versions of current document", async () => {
64
+ it("can handle bad document id when requesting versions", async () => {
65
65
  const resources = client.getContainerVersions("badid");
66
+ const errorFn = (error: Error): boolean => {
67
+ assert.notStrictEqual(error.message, undefined, "Azure Client error is undefined");
68
+ assert.strictEqual(
69
+ error.message,
70
+ "R11s fetch error: Document is deleted and cannot be accessed.",
71
+ `Unexpected error: ${error.message}`,
72
+ );
73
+ return true;
74
+ };
66
75
  await assert.rejects(
67
76
  resources,
68
- () => true,
77
+ errorFn,
69
78
  "We should not be able to get container versions.",
70
79
  );
71
80
  });
@@ -179,6 +188,16 @@ describe("Container copy scenarios", () => {
179
188
  */
180
189
  it("can handle non-existing container", async () => {
181
190
  const resources = client.copyContainer("badidoncopy", schema);
182
- await assert.rejects(resources, () => true, "We should not be able to copy container.");
191
+ const errorFn = (error: Error): boolean => {
192
+ assert.notStrictEqual(error.message, undefined, "Azure Client error is undefined");
193
+ assert.strictEqual(
194
+ error.message,
195
+ "R11s fetch error: Document is deleted and cannot be accessed.",
196
+ `Unexpected error: ${error.message}`,
197
+ );
198
+ return true;
199
+ };
200
+
201
+ await assert.rejects(resources, errorFn, "We should not be able to copy container.");
183
202
  });
184
203
  });
@@ -3,11 +3,13 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import { strict as assert } from "assert";
6
+
7
+ import { AzureClient } from "@fluidframework/azure-client";
6
8
  import { AttachState } from "@fluidframework/container-definitions";
7
9
  import { ContainerSchema } from "@fluidframework/fluid-static";
8
10
  import { SharedMap } from "@fluidframework/map";
9
11
  import { timeoutPromise } from "@fluidframework/test-utils";
10
- import { AzureClient } from "@fluidframework/azure-client";
12
+
11
13
  import { createAzureClient } from "./AzureClientFactory";
12
14
 
13
15
  describe("Container create scenarios", () => {
@@ -24,23 +26,6 @@ describe("Container create scenarios", () => {
24
26
  };
25
27
  });
26
28
 
27
- /**
28
- * Scenario: test when Azure Client is instantiated correctly, it can create
29
- * a container successfully.
30
- *
31
- * Expected behavior: an error should not be thrown nor should a rejected promise
32
- * be returned.
33
- */
34
- it("can create new Azure Fluid Relay container successfully", async () => {
35
- const resourcesP = client.createContainer(schema);
36
-
37
- await assert.doesNotReject(
38
- resourcesP,
39
- () => true,
40
- "container cannot be created in Azure Fluid Relay",
41
- );
42
- });
43
-
44
29
  /**
45
30
  * Scenario: test when an Azure Client container is created,
46
31
  * it is initially detached.
@@ -55,6 +40,10 @@ describe("Container create scenarios", () => {
55
40
  AttachState.Detached,
56
41
  "Container should be detached",
57
42
  );
43
+
44
+ // Make sure we can attach.
45
+ const containerId = await container.attach();
46
+ assert.strictEqual(typeof containerId, "string", "Attach did not return a string ID");
58
47
  });
59
48
 
60
49
  /**
@@ -139,6 +128,11 @@ describe("Container create scenarios", () => {
139
128
 
140
129
  const errorFn = (error: Error): boolean => {
141
130
  assert.notStrictEqual(error.message, undefined, "Azure Client error is undefined");
131
+ assert.strictEqual(
132
+ error.message,
133
+ "R11s fetch error: Document is deleted and cannot be accessed.",
134
+ `Unexpected error: ${error.message}`,
135
+ );
142
136
  return true;
143
137
  };
144
138
 
@@ -233,6 +233,7 @@ describe("Fluid data updates", () => {
233
233
  };
234
234
 
235
235
  const { container } = await client.createContainer(dynamicSchema);
236
+ await container.attach();
236
237
 
237
238
  const newDo = await container.create(TestDataObject);
238
239
  assert.ok(newDo?.handle);