In Svelte component I have a tag:
<h2 data-testid="organisation">
{@html organisation_name}
</h2>
Organisation name comes with Special Character Code, like so:
const organisation_name = 'TJ's Org 2'
I'm using Svelte @html tag so it renders as TJ's Org 2 in the browser.
The question is, how to compare it in Testing Library.
So far I've got this,
expect(getByTestId('organisation').textContent).toBe(organisation_name);
which fails and the result is obviously:
Expected: "TJ's Org 2"
Received: "TJ's Org 2"
Any idea how to convert organisation_name value in toBe method to be in readable format?