jest simulate toggle switch react native

JavaScript
fireEvent(getByTestId('switch-element-id'), 'valueChange', true || false);
Source

Also in JavaScript: