kopia lustrzana https://github.com/wagtail/wagtail
add mock for updateSettings when testing TableBlock
rodzic
31948fc9db
commit
8b32acb2ad
|
@ -67,6 +67,7 @@ describe('telepath: wagtail.widgets.TableInput', () => {
|
|||
let testValue;
|
||||
let handsontableConstructorMock;
|
||||
let renderMock;
|
||||
let updateSettingsMock;
|
||||
|
||||
// Call this to render the table block with the current settings
|
||||
const render = () => {
|
||||
|
@ -84,6 +85,7 @@ describe('telepath: wagtail.widgets.TableInput', () => {
|
|||
beforeEach(() => {
|
||||
handsontableConstructorMock = jest.fn();
|
||||
renderMock = jest.fn();
|
||||
updateSettingsMock = jest.fn();
|
||||
|
||||
class HandsontableMock {
|
||||
constructor(...args) {
|
||||
|
@ -93,6 +95,10 @@ describe('telepath: wagtail.widgets.TableInput', () => {
|
|||
render() {
|
||||
renderMock();
|
||||
}
|
||||
|
||||
updateSettings(opts) {
|
||||
updateSettingsMock(opts);
|
||||
}
|
||||
}
|
||||
|
||||
window.Handsontable = HandsontableMock;
|
||||
|
|
Ładowanie…
Reference in New Issue