-
Notifications
You must be signed in to change notification settings - Fork 172
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0dd0236
commit a718acf
Showing
6 changed files
with
63 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
packages/agents/lighthouse/test/tasks/propose/operations/propose.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { expect, getNtpTimeSeconds, getRandomBytes32 } from "@connext/nxtp-utils"; | ||
import { SinonStub, stub } from "sinon"; | ||
|
||
import { NoChainIdForHubDomain } from "../../../../src/tasks/propose/errors"; | ||
import { propose } from "../../../../src/tasks/propose/operations"; | ||
import * as ProposeFns from "../../../../src/tasks/propose/operations/propose"; | ||
import { proposeCtxMock, sendWithRelayerWithBackupStub } from "../../../globalTestHook"; | ||
import { mock } from "../../../mock"; | ||
import * as Mockable from "../../../../src/mockable"; | ||
|
||
describe("Operations: Propose", () => { | ||
describe("#propose", () => { | ||
beforeEach(() => {}); | ||
|
||
it("should throw an error if no hub domain id", async () => { | ||
proposeCtxMock.chainData = new Map(); | ||
await expect(propose()).to.eventually.be.rejectedWith(NoChainIdForHubDomain); | ||
}); | ||
|
||
it("should call propose snapshot succesfully", async () => { | ||
let proposeSnapshotStub = stub(ProposeFns, "proposeSnapshot").resolves(); | ||
|
||
(proposeCtxMock.adapters.database.getPendingSnapshots as SinonStub).resolves([mock.entity.snapshotRoot()]); | ||
|
||
await propose(); | ||
expect(proposeSnapshotStub).callCount(1); | ||
}); | ||
}); | ||
}); |