Fixes cpanel test cases and constants

This commit is contained in:
Akshay Nair committed 2020-10-11 15:20:02 +05:30
1 parent addf748158
commit c20f6d7673
3 files changed
+15 -10

No files matched your search

+5 -2
View File
@@ -12,7 +12,7 @@ describe('Cpanel client', () => {
describe('fetchzonerecords', () => {
it('should make the correct request', async () => {
const fetch = mockFetch((url, request) => {
expect(url).toBe('https://example.com:2000//json-api/cpanel?customonly=1&domain=is-a.dev&cpanel_jsonapi_user=boy&cpanel_jsonapi_module=ZoneEdit&cpanel_jsonapi_func=fetchzone_records&cpanel_jsonapi_apiversion=2');
expect(url).toBe('https://example.com:2000//json-api/cpanel?customonly=1&domain=a.b&cpanel_jsonapi_user=boy&cpanel_jsonapi_module=ZoneEdit&cpanel_jsonapi_func=fetchzone_records&cpanel_jsonapi_apiversion=2');
expect(request).toEqual({
headers: {
Authorization: 'cpanel boy:boybyebye',
@@ -26,6 +26,7 @@ describe('Cpanel client', () => {
port: 2000,
username: 'boy',
apiKey: 'boybyebye',
domain: 'a.b',
dependencies: { fetch },
});
@@ -48,6 +49,7 @@ describe('Cpanel client', () => {
port: 2000,
username: 'boy',
apiKey: 'boybyebye',
domain: 'a.b',
dependencies: { fetch },
});
@@ -58,7 +60,7 @@ describe('Cpanel client', () => {
describe('addzonerecord', () => {
it('should make the correct request', async () => {
const fetch = mockFetch((url, request) => {
expect(url).toBe('https://example.com:2000//json-api/cpanel?domain=is-a.dev&name=googo&type=CNAME&cname=beey&ttl=2020&cpanel_jsonapi_user=boy&cpanel_jsonapi_module=ZoneEdit&cpanel_jsonapi_func=add_zone_record&cpanel_jsonapi_apiversion=2');
expect(url).toBe('https://example.com:2000//json-api/cpanel?domain=a.b&name=googo&type=CNAME&cname=beey&ttl=2020&cpanel_jsonapi_user=boy&cpanel_jsonapi_module=ZoneEdit&cpanel_jsonapi_func=add_zone_record&cpanel_jsonapi_apiversion=2');
expect(request).toEqual({
headers: {
Authorization: 'cpanel boy:boybyebye',
@@ -72,6 +74,7 @@ describe('Cpanel client', () => {
port: 2000,
username: 'boy',
apiKey: 'boybyebye',
domain: 'a.b',
dependencies: { fetch },
});