From e7f2995143ff0a5a65c29b783e7b5092a4d23674 Mon Sep 17 00:00:00 2001 From: Arthur Cinader Date: Mon, 30 Jan 2017 10:28:52 -0800 Subject: [PATCH] Adjust a test for change to logging. (#3452) --- spec/FilesController.spec.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/spec/FilesController.spec.js b/spec/FilesController.spec.js index 66897ce7..def9e0ad 100644 --- a/spec/FilesController.spec.js +++ b/spec/FilesController.spec.js @@ -50,10 +50,15 @@ describe("FilesController",() =>{ ) .then(() => logController.getLogs({ from: Date.now() - 500, size: 1000 })) .then((logs) => { - const log = logs.pop(); - expect(log.level).toBe('error'); - expect(log.code).toBe(130); - expect(log.message).toBe('Could not store file.'); + // we get two logs here: 1. the source of the failure to save the file + // and 2 the message that will be sent back to the client. + const log1 = logs.pop(); + expect(log1.level).toBe('error'); + expect(log1.message).toBe('it failed'); + const log2 = logs.pop(); + expect(log2.level).toBe('error'); + expect(log2.code).toBe(130); + expect(log2.message).toBe('Could not store file.'); done(); }); });