Closed ricardobrg closed 1 year ago
— input:
scantype: ScanType | undefined
account?: ReceiptAccount
— output:
Promise<void>
— input:
account: ReceiptAccount
— output:
Promise<void>
— input:
account: ReceiptAccount | undefined
— output:
Promise<void>
— input:
void
— output:
Promise<void>
— input:
account: ReceiptAccount
— output:
void
— input:
account: ReceiptAccount
— output:
void
— input:
receipt: TikiReceiptCapture.Receipt
account?: TikiReceiptCapture.Account
— output:
Promise<void>
— input:
event: ReceiptEvent
details: { receipt: TikiReceiptCapture.Receipt, account: ReceiptAccount}
— output:
Promise<void>
— input:
void
— output:
promise<void>
— input:
event: HistoryEvent
— output:
void
— input:
void
— output
Promise<void>
— input:
void
— output:
void
— input:
id: string
— output:
Promise<void>
— input:
void
— output:
Promise<void>
— input:
licenseKey: string
productKey?: string
— output
Promise<void>
— input:
scanType: scanType | undefined
account?: Account
— output:
Promise<{
receipt: Receipt,
isRunning: boolean
account: Account}
— input:
username: string
password: string
provider: string
— output
Promise<Account>
— input:
username: string
password: string
provider: string
— output
Promise<void>
— input:
username: string
password: string
provider: string
— output
Promise<Account>
— input:
void
— output:
Promise<Account[]>
— input
username: string
provider: string
— output
Promise<Account>
— input
void
— output
void
exemplo
Scan method in receiot-service.ts
/**
login method in receipt-service.ts
logout method in receipt-service.ts
mocks
accounts method in receipt-service.ts
mocks
addReceipt in receipt-service
caso com receipt duplicado e não fraudulento caso com receipt não duplicado e fraudulento caso com receipt duplicado e fraudulento caso com receipt nao duplicado e nao fraudulento
-mocks this.tiki.sdk.ingest()
process in receipt-service
amount undefined amount não undefined
mock
load in history-service.ts
caso de event undefined
mocks
add in history-service.ts
caso event.type igual REDEEM caso event.type diferente REDEEM
redeem in history-service.ts
caso com a callback undefined caso com points undefined
mocks: this.tiki.sdk.createReceipt
As a maintainer I need to ensure that the code is well tested so that we can prevent any changes that might lead to new bugs
What is it now
The tests are outdated and insufficient
What it should be
All public methods should have tests. To achieve that we need a test plan that will tell what to test and how to.
Technical details
Use TIKI SDK Android as a sample of how to implement tests.
Acceptance criteria
A list of tests with input and output and the issues to implement it.