Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Commit 3d85fd0

Browse files
committed
Test for the case we're missing
1 parent 1f9c0af commit 3d85fd0

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

test/atom/pane-item.test.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,5 +309,21 @@ describe('PaneItem', function() {
309309

310310
assert.isTrue(stub.getElement().classList.contains('added'));
311311
});
312+
313+
it('adopts StubItems that are deserialized after the package has been initialized', function() {
314+
const wrapper = mount(
315+
<PaneItem workspace={workspace} uriPattern="atom-github://pattern/root/{id}">
316+
{({params, itemHolder}) => <Component ref={itemHolder.setter} text={params.id} />}
317+
</PaneItem>,
318+
);
319+
320+
const stub = StubItem.create('some-component', {title: 'Component'}, 'atom-github://pattern/root/45');
321+
workspace.getActivePane().addItem(stub);
322+
323+
wrapper.update();
324+
325+
assert.isTrue(wrapper.exists('Component[text="45"]'));
326+
assert.strictEqual(stub.getText(), '45');
327+
});
312328
});
313329
});

0 commit comments

Comments
 (0)