MCPcopy Index your code
hub / github.com/mailvelope/mailvelope / createMockSelection

Function createMockSelection

test/unit/__mocks__/mockDOM.js:36–46  ·  view source on GitHub ↗
(overrides = {})

Source from the content-addressed store, hash-verified

34 * @returns {Object} Mock Selection object
35 */
36export function createMockSelection(overrides = {}) {
37 return {
38 removeAllRanges: jest.fn(),
39 addRange: jest.fn(),
40 selectAllChildren: jest.fn(),
41 toString: jest.fn(() => ''),
42 getRangeAt: jest.fn(),
43 rangeCount: 0,
44 ...overrides
45 };
46}
47
48/**
49 * Creates a mock element with specific tagName behavior

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected