-
Notifications
You must be signed in to change notification settings - Fork 79
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
Showing
1 changed file
with
37 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { | ||
fetchExternalENSNamesRequest, | ||
FETCH_EXTERNAL_ENS_NAMES_REQUEST, | ||
FETCH_EXTERNAL_ENS_NAMES_SUCCESS, | ||
fetchExternalENSNamesSuccess, | ||
fetchExternalENSNamesFailure, | ||
FETCH_EXTERNAL_ENS_NAMES_FAILURE | ||
} from './actions' | ||
import { ENSError } from './types' | ||
|
||
let owner: string | ||
let names: string[] | ||
let error: ENSError | ||
|
||
beforeEach(() => { | ||
owner = '0x123' | ||
names = ['name1.eth', 'name2.eth'] | ||
error = { message: 'Some Error' } | ||
}) | ||
|
||
describe('when creating the action that signals the start of an external ens fetch request', () => { | ||
it('should return an action signaling the start of an external ens fetch request', () => { | ||
expect(fetchExternalENSNamesRequest(owner)).toEqual({ type: FETCH_EXTERNAL_ENS_NAMES_REQUEST, payload: { owner } }) | ||
}) | ||
}) | ||
|
||
describe('when creating the action that signals the successful fetch of external ens names', () => { | ||
it('should return an action signaling the successful fetch of external ens names', () => { | ||
expect(fetchExternalENSNamesSuccess(owner, names)).toEqual({ type: FETCH_EXTERNAL_ENS_NAMES_SUCCESS, payload: { owner, names } }) | ||
}) | ||
}) | ||
|
||
describe('when creating the action that signals the unsuccessful fetch of external ens names', () => { | ||
it('should return an action signaling the unsuccessful fetch of external ens names', () => { | ||
expect(fetchExternalENSNamesFailure(owner, error)).toEqual({ type: FETCH_EXTERNAL_ENS_NAMES_FAILURE, payload: { owner, error } }) | ||
}) | ||
}) |