From acbabb512b88b322e92c005d5c8069a075749d89 Mon Sep 17 00:00:00 2001 From: Felix Henninger Date: Sun, 7 May 2017 18:56:11 +0200 Subject: [PATCH] Test that nested components are permitted to log data when sequence is cancelled --- library/test/flow.js | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/library/test/flow.js b/library/test/flow.js index 95aa183fc..f58882823 100644 --- a/library/test/flow.js +++ b/library/test/flow.js @@ -2,7 +2,7 @@ describe('Flow control', () => { describe('prepare_nested', () => { // This is not ideal because the function - // is not tested directly. However, the function + // is not tested directly. Then again, it // is not public, so it's difficult to test // directly @@ -187,7 +187,22 @@ describe('Flow control', () => { }) }) - it('Abort does not trigger outstanding components', () => { + it('permits terminated component to log data', () => { + const a = new lab.core.Component({ data: { foo: 'bar' } }) + s.options.content = [a] + s.options.datastore = new lab.data.Store() + + return s.run().then(() => { + return s.end() + }).then(() => { + assert.equal( + s.options.datastore.get('foo'), + 'bar', + ) + }) + }) + + it('abort does not trigger outstanding components', () => { // Setup sequence const a = new lab.core.Component() const b = new lab.core.Component() @@ -429,7 +444,6 @@ describe('Flow control', () => { b3.end() assert.equal(p.progress, 1) }) - }) })