playwright-fluent
Version:
Fluent API around playwright
26 lines (25 loc) • 1.35 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const SUT = tslib_1.__importStar(require("../index"));
const select_options_in_handle_1 = require("../../select-options-in-handle");
describe('select options by value in handle', () => {
// eslint-disable-next-line @typescript-eslint/no-empty-function
beforeEach(() => { });
test('should throw an error when selector is undefined', async () => {
// Given
const handle = undefined;
// When
// Then
const expectedError = new Error("Cannot select options 'foo,bar' because no browser has been launched");
await SUT.selectOptionsByValueInHandle(handle, 'foobar', ['foo', 'bar'], undefined, select_options_in_handle_1.defaultSelectOptions).catch((error) => expect(error).toMatchObject(expectedError));
});
test('should throw an error when selector is null', async () => {
// Given
const handle = null;
// When
// Then
const expectedError = new Error("Cannot select options 'foo,bar' because no browser has been launched");
await SUT.selectOptionsByValueInHandle(handle, 'foobar', ['foo', 'bar'], undefined, select_options_in_handle_1.defaultSelectOptions).catch((error) => expect(error).toMatchObject(expectedError));
});
});
;