-
Notifications
You must be signed in to change notification settings - Fork 44
/
dnsRecordsGridView.test.js
71 lines (59 loc) · 2.22 KB
/
dnsRecordsGridView.test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/*
* Copyright (c) 2015 Juniper Networks, Inc. All rights reserved.
*/
define([
'co-test-runner',
'ct-test-utils',
'ct-test-messages',
'config/dns/records/test/ui/views/dnsRecordsGridView.mock.data',
'co-grid-contrail-list-model-test-suite',
'co-grid-view-test-suite'
], function (cotr, cttu, cttm, TestMockdata, GridListModelTestSuite, GridViewTestSuite) {
var moduleId = cttm.DNS_RECORDS_GRID_VIEW_TEST_MODULE;
var testType = cotc.VIEW_TEST;
var fakeServerConfig = cotr.getDefaultFakeServerConfig();
var fakeServerResponsesConfig = function() {
var responses = [];
responses.push(cotr.createFakeServerResponse({
url : /\/api\/tenants\/config\/domains.*$/,
body: JSON.stringify(TestMockdata.dnsRecordsDomainMockData)
}));
responses.push(cotr.createFakeServerResponse({
url : /\/api\/tenants\/config\/list-virtual-DNSs\/07fbaa4b-c7b8-4f3d-996e-9d8b1830b288.*$/,
body: JSON.stringify(TestMockdata.dnsServerListMockData)
}));
responses.push(cotr.createFakeServerResponse({
url : /\/api\/tenants\/config\/get-config-details.*$/,
method: "POST",
body: JSON.stringify(TestMockdata.dnsRecordsMockData)
}));
return responses;
};
fakeServerConfig.getResponsesConfig = fakeServerResponsesConfig;
var pageConfig = cotr.getDefaultPageConfig();
pageConfig.hashParams = {
p: 'config_dns_records',
q: {
uuid:'e59247c6-280f-47b7-a3f3-994f3108cf93'
}
};
pageConfig.loadTimeout = cotc.PAGE_LOAD_TIMEOUT * 2;
var getTestConfig = function() {
return {
rootView: configDNSRecordsLoader.dnsRecordsView,
tests: [
{
viewId: ctwc.DNS_RECORDS_GRID_ID,
suites: [
{
class: GridViewTestSuite,
groups: ['all']
}
]
}
]
} ;
};
var pageTestConfig = cotr.createPageTestConfig(moduleId, testType, fakeServerConfig, pageConfig, getTestConfig);
cotr.startTestRunner(pageTestConfig);
});