mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2026-05-02 00:07:23 +08:00
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.
This commit is contained in:
committed by
Ibby Hadeed
parent
03ff0a58cf
commit
f4b8236c8d
@@ -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();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user