-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: adds test coverage before refactoring
- Loading branch information
1 parent
6085910
commit 3a602f6
Showing
2 changed files
with
40 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,25 @@ | ||
import { testnet } from '@lens-protocol/env'; | ||
import { assertOk, evmAddress } from '@lens-protocol/types'; | ||
import { describe, it } from 'vitest'; | ||
|
||
import { FullAccountFragment } from '@lens-protocol/graphql'; | ||
import { PublicClient } from '../clients'; | ||
import { fetchAccount } from './account'; | ||
|
||
describe('Given the Account query actions', () => { | ||
const client = PublicClient.create({ | ||
environment: testnet, | ||
origin: 'http://example.com', | ||
accountFragment: FullAccountFragment, | ||
}); | ||
|
||
describe(`When invoking the '${fetchAccount.name}' action`, () => { | ||
it('Then it should not fail w/ a GQL BadRequest error', async () => { | ||
const result = await fetchAccount(client, { | ||
address: evmAddress(import.meta.env.TEST_ACCOUNT), | ||
}); | ||
console.log(result); | ||
assertOk(result); | ||
}); | ||
}); | ||
}); |
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,15 @@ | ||
import { assertOk } from '@lens-protocol/types'; | ||
import { describe, it } from 'vitest'; | ||
|
||
import { loginAsAccountOwner } from '../../testing-utils'; | ||
import { fetchNotifications } from './notifications'; | ||
|
||
describe(`Given the '${fetchNotifications.name}' action`, () => { | ||
describe('When invoked', () => { | ||
it('Then it should not fail w/ a GQL BadRequest error', async () => { | ||
const result = await loginAsAccountOwner().andThen(fetchNotifications); | ||
|
||
assertOk(result); | ||
}); | ||
}); | ||
}); |