Skip to content

Commit 171266a

Browse files
committed
Added test for discover email config
1 parent 437b3ba commit 171266a

File tree

6 files changed

+31
-14
lines changed

6 files changed

+31
-14
lines changed

doc/EmailAccountConfig.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
77
**displayName** | **string** | Email account display name | [optional] [default to undefined]
8-
**type** | **string** | Type of connection protocol. Enum, available values: IMAP, POP3, SMTP, EWS, WebDav | [default to undefined]
8+
**protocolType** | **string** | Type of connection protocol. Enum, available values: IMAP, POP3, SMTP, EWS, WebDav | [default to undefined]
99
**host** | **string** | Email account host. | [optional] [default to undefined]
1010
**port** | **number** | Port. | [optional] [default to undefined]
11-
**socketType** | **string** | Enum, available values: None, SSLExplicit, SSLImplicit, SSLAuto, Auto | [default to undefined]
11+
**socketType** | **string** | Security mode for a mail client Enum, available values: None, SSLExplicit, SSLImplicit, SSLAuto, Auto | [default to undefined]
1212
**authenticationTypes** | **Array<string>** | Supported authentication types. Items: Email account authentication types. Enum, available values: NoAuth, OAuth2, PasswordCleartext, PasswordEncrypted, SmtpAfterPop, ClientIpAddress | [optional] [default to undefined]
1313
**extraInfo** | [**Array<NameValuePair>**](NameValuePair.md) | Extra account information. | [optional] [default to undefined]
1414
**isValidated** | **boolean** | Determines that configuration validated. Set to false if validation skipped. | [default to undefined]

doc/EmailAccountRequest.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Name | Type | Description | Notes
77
**host** | **string** | Email account host | [default to undefined]
88
**port** | **number** | Email account port | [default to undefined]
99
**login** | **string** | Email account login | [default to undefined]
10-
**securityOptions** | **string** | Enum, available values: None, SSLExplicit, SSLImplicit, SSLAuto, Auto | [default to undefined]
10+
**securityOptions** | **string** | Security mode for a mail client Enum, available values: None, SSLExplicit, SSLImplicit, SSLAuto, Auto | [default to undefined]
1111
**protocolType** | **string** | Type of connection protocol. Enum, available values: IMAP, POP3, SMTP, EWS, WebDav | [default to undefined]
1212
**description** | **string** | Email account description | [optional] [default to undefined]
1313
**storageFile** | [**StorageFileLocation**](StorageFileLocation.md) | A storage file location info to store email account | [default to undefined]

doc/NameValuePair.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
## Properties
55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
7-
**value** | **string** | | [optional] [default to undefined]
8-
**name** | **string** | | [optional] [default to undefined]
7+
**value** | **string** | Name of the property | [optional] [default to undefined]
8+
**name** | **string** | Value of the property | [optional] [default to undefined]
99

1010

1111

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,4 @@
5353
"typescript": "^3.7.2",
5454
"uuid": "^3.3.3"
5555
}
56-
}
56+
}

src/model/model.ts

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2497,8 +2497,8 @@ export class EmailAccountConfig {
24972497
type: "string",
24982498
},
24992499
{
2500-
name: "type",
2501-
baseName: "type",
2500+
name: "protocolType",
2501+
baseName: "protocolType",
25022502
type: "string",
25032503
},
25042504
{
@@ -2547,7 +2547,7 @@ export class EmailAccountConfig {
25472547
/**
25482548
* Type of connection protocol. Enum, available values: IMAP, POP3, SMTP, EWS, WebDav
25492549
*/
2550-
public type: string;
2550+
public protocolType: string;
25512551

25522552
/**
25532553
* Email account host.
@@ -2560,7 +2560,7 @@ export class EmailAccountConfig {
25602560
public port: number;
25612561

25622562
/**
2563-
* Enum, available values: None, SSLExplicit, SSLImplicit, SSLAuto, Auto
2563+
* Security mode for a mail client Enum, available values: None, SSLExplicit, SSLImplicit, SSLAuto, Auto
25642564
*/
25652565
public socketType: string;
25662566

@@ -2582,7 +2582,7 @@ export class EmailAccountConfig {
25822582

25832583
public constructor(
25842584
displayName?: string,
2585-
type?: string,
2585+
protocolType?: string,
25862586
host?: string,
25872587
port?: number,
25882588
socketType?: string,
@@ -2591,7 +2591,7 @@ export class EmailAccountConfig {
25912591
isValidated?: boolean) {
25922592

25932593
this.displayName = displayName;
2594-
this.type = type;
2594+
this.protocolType = protocolType;
25952595
this.host = host;
25962596
this.port = port;
25972597
this.socketType = socketType;
@@ -2669,7 +2669,7 @@ export class EmailAccountRequest {
26692669
public login: string;
26702670

26712671
/**
2672-
* Enum, available values: None, SSLExplicit, SSLImplicit, SSLAuto, Auto
2672+
* Security mode for a mail client Enum, available values: None, SSLExplicit, SSLImplicit, SSLAuto, Auto
26732673
*/
26742674
public securityOptions: string;
26752675

@@ -4743,6 +4743,9 @@ export class ModelError {
47434743
}
47444744
}
47454745

4746+
/**
4747+
* An extended property.
4748+
*/
47464749
export class NameValuePair {
47474750

47484751
/**
@@ -4767,8 +4770,14 @@ export class NameValuePair {
47674770
return NameValuePair.attributeTypeMap;
47684771
}
47694772

4773+
/**
4774+
* Name of the property
4775+
*/
47704776
public value: string;
47714777

4778+
/**
4779+
* Value of the property
4780+
*/
47724781
public name: string;
47734782

47744783

tests/api-test.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import uuidv4 from 'uuid/v4';
44
import * as models from '../src/model/model';
55
import fs from 'fs';
66

7-
jasmine.DEFAULT_TIMEOUT_INTERVAL = 10000;
7+
jasmine.DEFAULT_TIMEOUT_INTERVAL = 100000;
88

99
describe('EmailApi', function() {
1010
var api :EmailApi;
@@ -263,6 +263,14 @@ describe('EmailApi', function() {
263263
expect(result.body.value[0].displayName).toContain("Thomas");
264264
});
265265

266+
it('Discover email config #pipeline', async function() {
267+
var configs = await api.discoverEmailConfig(new requests.DiscoverEmailConfigRequest(
268+
'example@gmail.com', true));
269+
expect(configs.body.value.length).toBeGreaterThanOrEqual(2);
270+
var smtp = configs.body.value.filter(item => item.protocolType == 'SMTP')[0];
271+
expect(smtp.host).toEqual('smtp.gmail.com');
272+
});
273+
266274
async function createCalendar(startDate? : Date) :Promise<string> {
267275
var fileName = uuidv4() + '.ics';
268276
startDate = (startDate == null) ? getDate(undefined, 1) : startDate;

0 commit comments

Comments
 (0)