Skip to content

Commit

Permalink
fix: userSeat.hasExited was returning the opposite of its intent
Browse files Browse the repository at this point in the history
fixes: #1729
  • Loading branch information
Chris-Hibbert committed Sep 10, 2020
1 parent c71d7f2 commit c00881b
Showing 1 changed file with 12 additions and 17 deletions.
29 changes: 12 additions & 17 deletions packages/zoe/test/unitTests/zcf/test-zcf.js
Original file line number Diff line number Diff line change
Expand Up @@ -667,32 +667,27 @@ test(`zcfSeat.getProposal from zcf.makeEmptySeatKit`, async t => {
});
});

test.failing(`zcfSeat.hasExited, exit from zcf.makeEmptySeatKit`, async t => {
test(`zcfSeat.hasExited, exit from zcf.makeEmptySeatKit`, async t => {
const { zcf } = await setupZCFTest();
const { zcfSeat, userSeat } = zcf.makeEmptySeatKit();
t.falsy(zcfSeat.hasExited());
zcfSeat.exit();
t.truthy(zcfSeat.hasExited());
// TODO: remove `failing` after fixing https://github.com/Agoric/agoric-sdk/issues/1729
t.truthy(await E(userSeat).hasExited());
t.deepEqual(await E(userSeat).getPayouts(), {});
});

test.failing(
`zcfSeat.hasExited, kickOut from zcf.makeEmptySeatKit`,
async t => {
const { zcf } = await setupZCFTest();
const { zcfSeat, userSeat } = zcf.makeEmptySeatKit();
t.falsy(zcfSeat.hasExited());
const msg = `this is the error message`;
const err = zcfSeat.kickOut(Error(msg));
t.is(err.message, msg);
t.truthy(zcfSeat.hasExited());
// TODO: remove `failing` after fixing https://github.com/Agoric/agoric-sdk/issues/1729
t.truthy(await E(userSeat).hasExited());
t.deepEqual(await E(userSeat).getPayouts(), {});
},
);
test(`zcfSeat.hasExited, kickOut from zcf.makeEmptySeatKit`, async t => {
const { zcf } = await setupZCFTest();
const { zcfSeat, userSeat } = zcf.makeEmptySeatKit();
t.falsy(zcfSeat.hasExited());
const msg = `this is the error message`;
const err = zcfSeat.kickOut(Error(msg));
t.is(err.message, msg);
t.truthy(zcfSeat.hasExited());
t.truthy(await E(userSeat).hasExited());
t.deepEqual(await E(userSeat).getPayouts(), {});
});

test(`zcfSeat.isOfferSafe from zcf.makeEmptySeatKit`, async t => {
const { zcf } = await setupZCFTest();
Expand Down

0 comments on commit c00881b

Please sign in to comment.