-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(inappbrowser): add interface for IAB options (#1065)
* Add InAppBrowserOptions Interface for better tooling. * feat(inappbrowser): add interface for IAB options * Add more constructor tests. * Add missing iOS options.
- Loading branch information
1 parent
03ff0a5
commit f4b8236
Showing
2 changed files
with
84 additions
and
6 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
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,30 @@ | ||
import { InAppBrowser, InAppBrowserEvent, InAppBrowserOptions } from '../../src/plugins/inappbrowser'; | ||
|
||
declare var window: any; | ||
|
||
window.cordova = { | ||
InAppBrowser: { | ||
open: window.open | ||
} | ||
}; | ||
|
||
describe('InAppBrowser', () => { | ||
|
||
const options: InAppBrowserOptions = { hidden: 'yes', hardwareback: 'no' }; | ||
let object; | ||
|
||
it('should create an object using strings and InAppBrowserOptions signature', () => { | ||
object = new InAppBrowser('http://google.com', '_self', options); | ||
expect(object).toBeDefined(); | ||
}); | ||
|
||
it('should create an object using string only signature', () => { | ||
object = new InAppBrowser('http://google.com', '_self', 'location=no'); | ||
expect(object).toBeDefined(); | ||
}); | ||
|
||
it('should create an object with the least amount of parameters', () => { | ||
object = new InAppBrowser('http://google.com'); | ||
expect(object).toBeDefined(); | ||
}); | ||
}); |