majestic
majestic copied to clipboard
Show a test html rendering
Feature request
When libraries like react-testing-libary
(that emulates user activity) is used It would be useful to view what is going on on the screen
function Counter(){
const [state, setState] = useState({value: 0})
return (
<div>
<span>{state.value}</span>
<button onClick={() => setState(state => ({value: state.value + 1}))}>
increase
</button>
</div>
)
}
it('counter test', async () => {
const { getByText } = render(<Counter />)
const button = getByText('increase')
fireEvent.click(button)
fireEvent.click(button)
fireEvent.click(button)
})
Majestic could show current document
so It would be possible to see how counter is working in the test.
if you have the HTML string, you could console.log() it and majestic would show you the string in the UI.
@Raathigesh Yes, for small html string it could work. But if it's a functional test for whole page, see such html string isn't very useful. In this case I would like to see rendered html in browser.