blob: cdfd91be9d6459cb0c5536b2f8010a5992ac6365 [file] [log] [blame]
svishnevea5e43c2018-04-15 09:06:57 +03001/*
2 * Copyright © 2016-2018 European Support Limited
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17import { Factory } from 'rosie';
18import randomstring from 'randomstring';
19import IdMixin from 'test-utils/factories/mixins/IdMixin.js';
20
21export const itemFactory = new Factory()
22 .extend(IdMixin)
23 .option('isArchived', false)
24 .attrs({
25 description: () => randomstring.generate(),
26 name: () => randomstring.generate(),
27 owner: () => randomstring.generate()
28 })
29 .attr('status', ['isArchived'], isArchived => {
30 return isArchived ? 'ARCHIVE' : 'ACTIVE';
31 });
32
33export const vspFactory = new Factory().extend(itemFactory).attrs({
34 type: 'vsp',
35 properties: {
36 onboardingMethod: 'NetworkPackage',
37 vendorId: randomstring.generate(33),
38 vendorName: randomstring.generate()
39 }
40});
41
42export const vlmFactory = new Factory().extend(itemFactory).attrs({
43 type: 'vlm',
44 properties: {}
45});