Skip to content

Commit

Permalink
fix(tests): tests do not consider updated behavior of MessageCompound…
Browse files Browse the repository at this point in the history
…BatchVisitor

refs conjoon/php-lib-conjoon#8
  • Loading branch information
ThorstenSuckow committed Jun 22, 2022
1 parent d709694 commit 7d8311b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/data/mail/message/session/MessageCompoundBatchVisitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ Ext.define("conjoon.cn_mail.data.mail.message.session.MessageCompoundBatchVisito

/**
* Swaps a CREATE operation with an UPDATE operation if the previous operation
* applied a compound key to the record that is part of the following
* operation.
* applied a compound key to the record that is required by the following
* UPDATE-operation, if any.
* Will assign the id returned by the DESTROY operation and update the
* MessageDraft this class was configured with.
* Makes sure that data that is about to be destroyed gets the current
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,11 @@ StartTest(async t => {

t.it("Should properly test behavior", t => {

/**
* @note the behavior changed with conjoon/php-lib-conjoon#8.
* The first entity sent to the backend is always a MessageDraft, followed by
* the MessageBody and the attachments.
*/
let session = setupSession();

let batch = session.getSaveBatch();
Expand Down Expand Up @@ -271,9 +276,9 @@ StartTest(async t => {
}

// t.expect(operations[1].id).not.toBe(oldId);
t.expect(operations[1]).not.toBe(oldOp);
t.expect(operations[1].getAction()).toBe("update");
t.expect(operations[1].getParams().origin).toBe("create");
t.expect(operations[1]).toBe(oldOp);
t.expect(operations[1].getAction()).toBe("create");
t.expect(operations[1].getParams()).toBeUndefined();
t.expect(operations[1].getRecords()[0]).toBe(oldRecord[0]);
CMP_REC = operations[1].getRecords()[0];
});
Expand Down

0 comments on commit 7d8311b

Please sign in to comment.