awesome-cordova-plugins/test/plugins/inappbrowser.spec.ts
Eric Horodyski f4b8236c8d 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.
2017-02-15 16:57:16 -05:00

31 lines
856 B
TypeScript

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();
});
});