Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task/843 add test class for type script #1024

Merged
merged 2 commits into from
Jul 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"description": "updated on deploy",
"key": "testExisting_script",
"name": "testExisting_script",
"r__folder_Path": "Scripts"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// dummy updated
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"description": "created on deploy",
"key": "testNew_script",
"name": "testNew_script",
"r__folder_Path": "Scripts"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// dummy created
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"ssjsActivityId": "39f6a488-20eb-4ba0-b0b9-023725b574e4",
"name": "testExisting_script",
"key": "testExisting_script",
"description": "updated on deploy",
"script": "<script runat=\"server\">\n// dummy updated\n</script>",
"categoryId": 304,
"createdDate": "2022-10-20T00:41:26.163",
"modifiedDate": "2022-10-20T00:41:26.163"
}
14 changes: 12 additions & 2 deletions test/resources/9999999/automation/v1/scripts/get-response.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,18 @@
"name": "testExisting_script",
"key": "testExisting_script",
"description": "",
"script": "<script runat=\"server\">\n//dummy\n</script",
"categoryId": 290828,
"script": "<script runat=\"server\">\n//dummy\n</script>",
"categoryId": 304,
"createdDate": "2022-10-20T00:41:26.163",
"modifiedDate": "2022-10-20T00:41:26.163"
},
{
"ssjsActivityId": "39f6a488-20eb-4ba0-b0b9-noScriptTag",
"name": "testExisting_script_noScriptTag",
"key": "testExisting_script_noScriptTag",
"description": "",
"script": "// no script tag\n",
"categoryId": 304,
"createdDate": "2022-10-20T00:41:26.163",
"modifiedDate": "2022-10-20T00:41:26.163"
}
Expand Down
10 changes: 10 additions & 0 deletions test/resources/9999999/automation/v1/scripts/post-response.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"ssjsActivityId": "39f6a488-20eb-4ba0-b0b9-new",
"name": "testNew_script",
"key": "testNew_script",
"description": "created on deploy",
"script": "<script runat=\"server\">\n// dummy created\n</script>",
"categoryId": 304,
"createdDate": "2022-10-20T00:41:26.163",
"modifiedDate": "2022-10-20T00:41:26.163"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<soap:Header>
<wsa:Action>RetrieveResponse</wsa:Action>
<wsa:MessageID>urn:uuid:f36f3303-3b5a-4641-8109-b26447634d91</wsa:MessageID>
<wsa:RelatesTo>urn:uuid:33983968-28c4-4379-bb5f-f80ae32eb988</wsa:RelatesTo>
<wsa:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:To>
<wsse:Security>
<wsu:Timestamp wsu:Id="Timestamp-32ecc81b-6020-473c-9e99-4b5338921220">
<wsu:Created>2022-04-19T20:03:41Z</wsu:Created>
<wsu:Expires>2022-04-19T20:08:41Z</wsu:Expires>
</wsu:Timestamp>
</wsse:Security>
</soap:Header>
<soap:Body>
<RetrieveResponseMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
<OverallStatus>OK</OverallStatus>
<RequestID>02cd5ccb-8f84-4651-826f-71169eeecf05</RequestID>
<Results xsi:type="DataFolder">
<Client>
<ID>9999999</ID>
</Client>
<PartnerKey xsi:nil="true" />
<CreatedDate>2017-01-24T06:32:42.353</CreatedDate>
<ModifiedDate>2017-01-24T06:32:42.353</ModifiedDate>
<ID>304</ID>
<ObjectID xsi:nil="true" />
<CustomerKey>SSJSActivity_default</CustomerKey>
<ParentFolder>
<PartnerKey xsi:nil="true" />
<ID>0</ID>
<ObjectID xsi:nil="true" />
</ParentFolder>
<Name>Scripts</Name>
<Description />
<ContentType>SSJSActivity</ContentType>
<IsActive>true</IsActive>
<IsEditable>false</IsEditable>
<AllowChildren>true</AllowChildren>
</Results>
</RetrieveResponseMsg>
</soap:Body>
</soap:Envelope>
6 changes: 6 additions & 0 deletions test/resources/9999999/script/build-expected.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"description": "",
"key": "testTemplated_script",
"name": "testTemplated_script",
"r__folder_Path": "Scripts"
}
1 change: 1 addition & 0 deletions test/resources/9999999/script/build-expected.ssjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
//dummy
8 changes: 8 additions & 0 deletions test/resources/9999999/script/get-expected.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"createdDate": "2022-10-20T00:41:26.163",
"description": "",
"key": "testExisting_script",
"modifiedDate": "2022-10-20T00:41:26.163",
"name": "testExisting_script",
"r__folder_Path": "Scripts"
}
1 change: 1 addition & 0 deletions test/resources/9999999/script/get-expected.ssjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
//dummy
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// no script tag
8 changes: 8 additions & 0 deletions test/resources/9999999/script/get_noScriptTag-expected.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"createdDate": "2022-10-20T00:41:26.163",
"description": "",
"key": "testExisting_script_noScriptTag",
"modifiedDate": "2022-10-20T00:41:26.163",
"name": "testExisting_script_noScriptTag",
"r__folder_Path": "Scripts"
}
8 changes: 8 additions & 0 deletions test/resources/9999999/script/patch-expected.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"createdDate": "2022-10-20T00:41:26.163",
"description": "updated on deploy",
"key": "testExisting_script",
"modifiedDate": "2022-10-20T00:41:26.163",
"name": "testExisting_script",
"r__folder_Path": "Scripts"
}
1 change: 1 addition & 0 deletions test/resources/9999999/script/patch-expected.ssjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// dummy updated
8 changes: 8 additions & 0 deletions test/resources/9999999/script/post-expected.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"createdDate": "2022-10-20T00:41:26.163",
"description": "created on deploy",
"key": "testNew_script",
"modifiedDate": "2022-10-20T00:41:26.163",
"name": "testNew_script",
"r__folder_Path": "Scripts"
}
1 change: 1 addition & 0 deletions test/resources/9999999/script/post-expected.ssjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// dummy created
6 changes: 6 additions & 0 deletions test/resources/9999999/script/template-expected.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"description": "",
"key": "{{{prefix}}}script",
"name": "{{{prefix}}}script",
"r__folder_Path": "Scripts"
}
1 change: 1 addition & 0 deletions test/resources/9999999/script/template-expected.ssjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
//dummy
Loading
Loading