-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6661 from vegaprotocol/chore/release-v0.26.16
chore(trading,explorer,governance): release v0.26.16
- Loading branch information
Showing
190 changed files
with
13,346 additions
and
6,877 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
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
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
65 changes: 65 additions & 0 deletions
65
apps/explorer/src/app/components/txs/details/transfer/blocks/transfer-status.spec.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,65 @@ | ||
import { render, screen } from '@testing-library/react'; | ||
import { | ||
fixStatus, | ||
TransferStatusIcon, | ||
getIconForStatus, | ||
getColourForStatus, | ||
} from './transfer-status'; | ||
import { TransferStatus, TransferStatusMapping } from '@vegaprotocol/types'; | ||
import addYears from 'date-fns/addYears'; | ||
import subYears from 'date-fns/subYears'; | ||
|
||
describe('TransferStatusIcon', () => { | ||
it('renders transfer status icon', () => { | ||
const status = TransferStatus.STATUS_PENDING; | ||
render(<TransferStatusIcon status={status} />); | ||
expect( | ||
screen.getByTitle(TransferStatusMapping[status]) | ||
).toBeInTheDocument(); | ||
}); | ||
}); | ||
|
||
describe('getIconForStatus', () => { | ||
it('returns correct icon name for transfer status', () => { | ||
expect(getIconForStatus(TransferStatus.STATUS_PENDING)).toBe('time'); | ||
expect(getIconForStatus(TransferStatus.STATUS_DONE)).toBe('tick'); | ||
expect(getIconForStatus(TransferStatus.STATUS_REJECTED)).toBe('cross'); | ||
expect(getIconForStatus(TransferStatus.STATUS_CANCELLED)).toBe('cross'); | ||
expect(getIconForStatus('' as TransferStatus)).toBe('time'); | ||
}); | ||
}); | ||
|
||
describe('getColourForStatus', () => { | ||
it('returns correct colour for transfer status', () => { | ||
expect(getColourForStatus(TransferStatus.STATUS_PENDING)).toBe( | ||
'text-yellow-500' | ||
); | ||
expect(getColourForStatus(TransferStatus.STATUS_DONE)).toBe( | ||
'text-green-500' | ||
); | ||
expect(getColourForStatus(TransferStatus.STATUS_REJECTED)).toBe( | ||
'text-red-500' | ||
); | ||
expect(getColourForStatus(TransferStatus.STATUS_CANCELLED)).toBe( | ||
'text-red-600' | ||
); | ||
expect(getColourForStatus('' as TransferStatus)).toBe('text-yellow-500'); | ||
}); | ||
}); | ||
|
||
describe('fixStatus', () => { | ||
it('returns STATUS_PENDING if deliverOn is a future date', () => { | ||
const status = TransferStatus.STATUS_DONE; | ||
const deliverOn = addYears(new Date(), 1).toISOString(); | ||
const fixedStatus = fixStatus(status, deliverOn); | ||
expect(fixedStatus).toBe(TransferStatus.STATUS_PENDING); | ||
}); | ||
|
||
it('returns the same status if deliverOn is not a future date', () => { | ||
const status = TransferStatus.STATUS_DONE; | ||
// Just to be safe, make deliverOn a date in the far past | ||
const deliverOn = subYears(new Date(), 1).toISOString(); | ||
const fixedStatus = fixStatus(status, deliverOn); | ||
expect(fixedStatus).toBe(status); | ||
}); | ||
}); |
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.