-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'clearcontracts/main' into test
- Loading branch information
Showing
34 changed files
with
505 additions
and
140 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 |
---|---|---|
|
@@ -10,7 +10,6 @@ export const getRepresentativesHandlers = [ | |
is_alternate: false, | ||
workshop_id: BigInt(1).toString(), | ||
email: '[email protected]', | ||
color: '#000000', | ||
wallet_address: 'addr1isdufnpoasidjfopmaimdfmopisadj', | ||
name: 'John Johnson', | ||
}, | ||
|
@@ -21,7 +20,6 @@ export const getRepresentativesHandlers = [ | |
is_alternate: true, | ||
workshop_id: BigInt(1).toString(), | ||
email: '[email protected]', | ||
color: '#000000', | ||
wallet_address: 'addr1oqwieuroijfvaondsfipoaapoidjf', | ||
name: 'Mike Mickelson', | ||
}, | ||
|
@@ -32,7 +30,6 @@ export const getRepresentativesHandlers = [ | |
is_alternate: false, | ||
workshop_id: BigInt(2).toString(), | ||
email: '[email protected]', | ||
color: '#000000', | ||
wallet_address: 'addr1kidjfsadjfoadspjfoaidsfadsop', | ||
name: 'Jack Jackson', | ||
}, | ||
|
@@ -43,7 +40,6 @@ export const getRepresentativesHandlers = [ | |
is_alternate: true, | ||
workshop_id: BigInt(2).toString(), | ||
email: '[email protected]', | ||
color: '#000000', | ||
wallet_address: 'addr1iwoiuwqxpoieujsoidpjfkfjhpqowmfoa', | ||
name: 'Robert Robertson', | ||
}, | ||
|
@@ -54,7 +50,6 @@ export const getRepresentativesHandlers = [ | |
is_alternate: false, | ||
workshop_id: BigInt(3).toString(), | ||
email: '[email protected]', | ||
color: '#000000', | ||
wallet_address: 'addr1opijpoiuoimnlkjipoujpoimlkkm', | ||
name: 'Connor Connorson', | ||
}, | ||
|
@@ -65,7 +60,6 @@ export const getRepresentativesHandlers = [ | |
is_alternate: true, | ||
workshop_id: BigInt(3).toString(), | ||
email: '[email protected]', | ||
color: '#000000', | ||
wallet_address: 'addr1adfasdfwerwqersdvfzxfvsadf', | ||
name: 'Kyle Kyleson', | ||
}, | ||
|
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
33 changes: 33 additions & 0 deletions
33
...ponents/coordinator/manageRepresentativesTable/stripsWhitespaceFromWalletAddress.test.tsx
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,33 @@ | ||
import { render, screen } from '@testing-library/react'; | ||
import userEvent from '@testing-library/user-event'; | ||
import { Toaster } from 'react-hot-toast'; | ||
import { expect, test } from 'vitest'; | ||
|
||
import { ManageRepresentativesTable } from '@/components/coordinator/manageRepresentativesTable'; | ||
|
||
test('strips whitespace from wallet address', async () => { | ||
const user = userEvent.setup(); | ||
render( | ||
<> | ||
<Toaster /> | ||
<ManageRepresentativesTable toggleRefresh={() => {}} /> | ||
</>, | ||
); | ||
|
||
const editButton = await screen.findByTestId('edit-representative-info-1'); | ||
await user.click(editButton); | ||
|
||
const input = screen.getByDisplayValue('addr1isdufnpoasidjfopmaimdfmopisadj'); | ||
await user.clear(input); | ||
await user.type(input, ' coStakeAddress '); | ||
|
||
const saveButton = await screen.findByTestId('save-representative-info-1'); | ||
await user.click(saveButton); | ||
|
||
// Wait for the success toast to appear | ||
const successToast = await screen.findByText('User info updated!'); | ||
expect(successToast).toBeDefined(); | ||
|
||
const newWalletAddress = await screen.findByText('coStakeAddress'); | ||
expect(newWalletAddress).toBeDefined(); | ||
}); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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.