Commit c4615792 authored by Robert Knight's avatar Robert Knight

Add missing `wrapper.update()` and `act` calls

This test happened to pass before, but failed after an adapter upgrade.
All external state changes should be wrapped in `act` to flush state
updates and effects and followed by `wrapper.update` to update the
Enzyme adapter.
parent ed3d3886
'use strict';
const { createElement } = require('preact');
const { act } = require('preact/test-utils');
const { mount } = require('enzyme');
const Timestamp = require('../timestamp');
......@@ -72,7 +73,10 @@ describe('Timestamp', () => {
});
fakeTime.toFuzzyString.returns('60 jiffies');
clock.tick(1000);
act(() => {
clock.tick(1000);
});
wrapper.update();
assert.equal(wrapper.text(), '60 jiffies');
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment