-
-
Save skayred/5d189300d2a23a33d15210eceeba554c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {toBeInTheDocument, toHaveClass} from '@testing-library/jest-dom' | |
expect.extend({toBeInTheDocument, toHaveClass}); | |
import { | |
getByLabelText, | |
getByText, | |
getByTestId, | |
queryByTestId, | |
wait, | |
waitForDomChange, | |
// fireEvent, | |
querySelector | |
} from '@testing-library/dom' | |
import '@testing-library/jest-dom/extend-expect' | |
beforeEach(() => { | |
var html = require('fs').readFileSync('./index.html').toString(); | |
global.document.documentElement.innerHTML = html; | |
require('./index'); | |
}); | |
it("renders_container", () => { | |
expect( | |
document.getElementById('board'), | |
).toBeInTheDocument() | |
}); | |
it("renders_table", async () => { | |
waitForDomChange(); | |
console.log(global.document.documentElement.innerHTML); | |
console.log(document.documentElement.innerHTML); | |
expect( | |
document.documentElement.getElementsByTagName('td').length, | |
).toEqual(5*5); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment