majestic icon indicating copy to clipboard operation
majestic copied to clipboard

Show a test html rendering

Open user753 opened this issue 5 years ago • 2 comments

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.

user753 avatar Sep 24 '19 14:09 user753

if you have the HTML string, you could console.log() it and majestic would show you the string in the UI.

Raathigesh avatar Oct 04 '19 07:10 Raathigesh

@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.

user753 avatar Oct 04 '19 07:10 user753