Skip to content

Commit

Permalink
Mocked account creation methods in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aaroncox committed Nov 6, 2023
1 parent de45022 commit 7154d6c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
7 changes: 7 additions & 0 deletions test/tests/kit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
Logo,
Session,
SessionKit,
UserInterfaceAccountCreationResponse,
UserInterfaceLoginResponse,
} from '$lib'

Expand Down Expand Up @@ -594,6 +595,12 @@ suite('kit', function () {
walletPluginIndex: 999999,
}
}
onAccountCreate(): Promise<UserInterfaceAccountCreationResponse> {
throw new Error('Not implemented in mock UI')
}
onAccountCreateComplete(): Promise<void> {
throw new Error('Not implemented in mock UI')
}
}
const sessionKit = new SessionKit(
{
Expand Down
14 changes: 13 additions & 1 deletion test/tests/ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ import {assert} from 'chai'
import type {LocaleDefinitions} from '@wharfkit/common'
import {MockUserInterface} from '@wharfkit/mock-data'

import {UserInterface, UserInterfaceTranslateOptions} from 'src/ui'
import {
UserInterface,
UserInterfaceAccountCreationResponse,
UserInterfaceTranslateOptions,
} from 'src/ui'

const mockLocaleDefinitions: LocaleDefinitions = {
en: {
Expand Down Expand Up @@ -34,6 +38,14 @@ class ImplementedUI extends MockUserInterface {
}
return this.localeDefinitions.en[key] || options?.default || `[[${key} not localized]]`
}

onAccountCreate(): Promise<UserInterfaceAccountCreationResponse> {
throw new Error('Not implemented in mock UI')
}

onAccountCreateComplete(): Promise<void> {
throw new Error('Not implemented in mock UI')
}
}

suite('ui', function () {
Expand Down

0 comments on commit 7154d6c

Please sign in to comment.