[TNL-7268] Fix tests and dependencies after rebase
This commit is contained in:
@@ -72,9 +72,11 @@ describe('Unit', () => {
|
||||
|
||||
window.postMessage(testMessageWithUnhandledType, '*');
|
||||
// HACK: We don't have a function we could reliably await here, so this test relies on the timeout of `waitFor`.
|
||||
// FIXME: After the last updates `toThrowErrorMatchingSnapshot` (due to a bug) started returning DOM
|
||||
// after the error, so we had to fall back to `toThrowError` assertion for better readability.
|
||||
await expect(waitFor(
|
||||
() => expect(screen.getByTitle(mockData.id)).toHaveAttribute('height', String(testMessageWithUnhandledType.payload.height)),
|
||||
{ timeout: 100 },
|
||||
)).rejects.toThrowErrorMatchingSnapshot();
|
||||
)).rejects.toThrowError(/Expected the element to have attribute/);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -42,15 +42,6 @@ exports[`Unit handles receiving MessageEvent 1`] = `
|
||||
title=\\"3\\""
|
||||
`;
|
||||
|
||||
exports[`Unit ignores MessageEvent with unhandled type 1`] = `
|
||||
"[2mexpect([22m[31melement[39m[2m).toHaveAttribute([22m[32m[32m\\"height\\"[39m[32m[39m[2m, [22m[32m[32m\\"300\\"[39m[32m[39m[2m) // element.getAttribute(\\"height\\") === \\"300\\"[22m
|
||||
|
||||
Expected the element to have attribute:
|
||||
[32m height=\\"300\\"[39m
|
||||
Received:
|
||||
[31m height=\\"0\\"[39m"
|
||||
`;
|
||||
|
||||
exports[`Unit renders correctly 1`] = `
|
||||
<DocumentFragment>
|
||||
<div
|
||||
|
||||
@@ -4,7 +4,7 @@ import UnitIcon from './UnitIcon';
|
||||
|
||||
describe('Unit Icon', () => {
|
||||
const types = {
|
||||
video: 'fa-film',
|
||||
video: 'fa-video',
|
||||
other: 'fa-book',
|
||||
vertical: 'fa-tasks',
|
||||
problem: 'fa-edit',
|
||||
@@ -20,7 +20,7 @@ describe('Unit Icon', () => {
|
||||
}
|
||||
|
||||
const { asFragment } = render(<UnitIcon type={key} />);
|
||||
expect(screen.getByAltText(value)).toBeInTheDocument();
|
||||
expect(screen.getByTestId('icon')).toHaveClass(value);
|
||||
expect(asFragment()).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -53,8 +53,8 @@ exports[`Unit Icon renders correct icon for vertical unit 1`] = `
|
||||
exports[`Unit Icon renders correct icon for video unit 1`] = `
|
||||
<DocumentFragment>
|
||||
<img
|
||||
alt="fa-film"
|
||||
class="fa-film"
|
||||
alt="fa-video"
|
||||
class="fa-video"
|
||||
data-testid="icon"
|
||||
/>
|
||||
</DocumentFragment>
|
||||
|
||||
Reference in New Issue
Block a user