-
Notifications
You must be signed in to change notification settings - Fork 286
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(core-test-framework): implement transfer factory
- Loading branch information
1 parent
e323bb5
commit de75e6e
Showing
15 changed files
with
380 additions
and
132 deletions.
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
56 changes: 56 additions & 0 deletions
56
__tests__/unit/core-test-framework/factories/factories/transaction.test.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,56 @@ | ||
import "jest-extended"; | ||
|
||
import { FactoryBuilder, Factories } from "@packages/core-test-framework/src/factories"; | ||
|
||
let factory: FactoryBuilder; | ||
|
||
beforeEach(() => { | ||
factory = new FactoryBuilder(); | ||
|
||
Factories.registerTransactionFactory(factory); | ||
}); | ||
|
||
describe("TransactionFactory", () => { | ||
describe("Transfer", () => { | ||
it("should create a transfer builder", () => { | ||
const { data } = factory.get("Transfer").make(); | ||
|
||
expect(data.signature).toBeUndefined(); | ||
expect(data.secondSignature).toBeUndefined(); | ||
expect(data.signatures).toBeUndefined(); | ||
}); | ||
|
||
it("should create a transfer that is signed with a single passphrase", () => { | ||
const { data } = factory | ||
.get("Transfer") | ||
.withStates("sign") | ||
.make(); | ||
|
||
expect(data.signature).not.toBeUndefined(); | ||
expect(data.secondSignature).toBeUndefined(); | ||
expect(data.signatures).toBeUndefined(); | ||
}); | ||
|
||
it("should create a transfer that is signed with a second passphrase", () => { | ||
const { data } = factory | ||
.get("Transfer") | ||
.withStates("sign", "secondSign") | ||
.make(); | ||
|
||
expect(data.signature).not.toBeUndefined(); | ||
expect(data.secondSignature).not.toBeUndefined(); | ||
expect(data.signatures).toBeUndefined(); | ||
}); | ||
|
||
it("should create a transfer that is signed with multiple passphrase", () => { | ||
const { data } = factory | ||
.get("Transfer") | ||
.withStates("sign", "multiSign") | ||
.make(); | ||
|
||
expect(data.signature).not.toBeUndefined(); | ||
expect(data.secondSignature).toBeUndefined(); | ||
expect(data.signatures).not.toBeUndefined(); | ||
}); | ||
}); | ||
}); |
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
Oops, something went wrong.