UNPKG

1.62 kBJavaScriptView Raw
1/**
2 * @licstart The following is the entire license notice for the
3 * Javascript code in this page
4 *
5 * Copyright 2017 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
24var _document = require('../../core/document');
25
26describe('document', function () {
27 describe('Page', function () {
28 it('should create correct objId using the idFactory', function () {
29 var page1 = new _document.Page({
30 pdfManager: {},
31 pageIndex: 0
32 });
33 var page2 = new _document.Page({
34 pdfManager: {},
35 pageIndex: 1
36 });
37 var idFactory1 = page1.idFactory,
38 idFactory2 = page2.idFactory;
39 expect(idFactory1.createObjId()).toEqual('p0_1');
40 expect(idFactory1.createObjId()).toEqual('p0_2');
41 expect(idFactory2.createObjId()).toEqual('p1_1');
42 expect(idFactory2.createObjId()).toEqual('p1_2');
43 expect(idFactory1.createObjId()).toEqual('p0_3');
44 expect(idFactory1.createObjId()).toEqual('p0_4');
45 });
46 });
47});
\No newline at end of file