document_spec.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /**
  2. * @licstart The following is the entire license notice for the
  3. * Javascript code in this page
  4. *
  5. * Copyright 2020 Mozilla Foundation
  6. *
  7. * Licensed under the Apache License, Version 2.0 (the "License");
  8. * you may not use this file except in compliance with the License.
  9. * You may obtain a copy of the License at
  10. *
  11. * http://www.apache.org/licenses/LICENSE-2.0
  12. *
  13. * Unless required by applicable law or agreed to in writing, software
  14. * distributed under the License is distributed on an "AS IS" BASIS,
  15. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  16. * See the License for the specific language governing permissions and
  17. * limitations under the License.
  18. *
  19. * @licend The above is the entire license notice for the
  20. * Javascript code in this page
  21. */
  22. "use strict";
  23. var _test_utils = require("./test_utils.js");
  24. describe("document", function () {
  25. describe("Page", function () {
  26. it("should create correct objId using the idFactory", function () {
  27. const idFactory1 = (0, _test_utils.createIdFactory)(0);
  28. const idFactory2 = (0, _test_utils.createIdFactory)(1);
  29. expect(idFactory1.createObjId()).toEqual("p0_1");
  30. expect(idFactory1.createObjId()).toEqual("p0_2");
  31. expect(idFactory1.getDocId()).toEqual("g_d0");
  32. expect(idFactory2.createObjId()).toEqual("p1_1");
  33. expect(idFactory2.createObjId()).toEqual("p1_2");
  34. expect(idFactory2.getDocId()).toEqual("g_d0");
  35. expect(idFactory1.createObjId()).toEqual("p0_3");
  36. expect(idFactory1.createObjId()).toEqual("p0_4");
  37. expect(idFactory1.getDocId()).toEqual("g_d0");
  38. });
  39. });
  40. });