-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
129 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
# pulumi-link-mobility-provider | ||
|
||
```bash | ||
npm link .. | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
encryptionsalt: v1:XbnIsPJjAKk=:v1:JP1+ntD/KahbnJtH:nqEMZk68CMXs21lq0nMDfil9dtcMUQ== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import { | ||
LinkMobilityPartnerGateService, | ||
LinkMobilityPartnerGateServiceInputs, | ||
} from '../link-mobility.service'; | ||
|
||
describe('Test suite for link mobility partner gate service', () => { | ||
let linkMobilityService: LinkMobilityPartnerGateService; | ||
const mockFetch = jest.fn(); | ||
|
||
beforeEach(async () => { | ||
jest.resetModules(); | ||
global.fetch = mockFetch; | ||
linkMobilityService = new LinkMobilityPartnerGateService({ | ||
username: 'username', | ||
password: 'password', | ||
url: 'http://some-url.com', | ||
platform: 'platform', | ||
partner: 'partner', | ||
}); | ||
}); | ||
|
||
afterEach(() => { | ||
jest.clearAllMocks(); | ||
}); | ||
|
||
it('should fail to initialise if url is invalid', async () => { | ||
// Arrange | ||
const ctorInput: LinkMobilityPartnerGateServiceInputs = { | ||
username: 'username', | ||
password: 'password', | ||
url: 'invalid-url', | ||
platform: 'platform', | ||
partner: 'partner', | ||
}; | ||
|
||
// Act & Assert | ||
expect(() => { | ||
new LinkMobilityPartnerGateService(ctorInput); | ||
}).toThrowError(); | ||
}); | ||
}); | ||
|
||
it('should initialise if url is valid', async () => { | ||
// Arrange | ||
const ctorInput: LinkMobilityPartnerGateServiceInputs = { | ||
username: 'username', | ||
password: 'password', | ||
url: 'http://some-url.com', | ||
platform: 'platform', | ||
partner: 'partner', | ||
}; | ||
|
||
// Act | ||
const service = new LinkMobilityPartnerGateService(ctorInput); | ||
|
||
// Assert | ||
expect(service).toBeDefined(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './is-partner-gate-destination-inputs'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { LinkMobilityPartnerGateDestinationInputs } from '../link-mobility.provider'; | ||
|
||
export function isLinkMobilityPartnerGateDestinationInputs( | ||
inputs: any | ||
): inputs is LinkMobilityPartnerGateDestinationInputs { | ||
return ( | ||
inputs && typeof inputs.partnerGateId === 'string' && typeof inputs.destination === 'object' | ||
); | ||
} |