uniswap-interface-uncensored/src/hooks/useTokenWarningColor.test.ts
Nate Wienert 59db4c5b02
feat: Spore colors refresh (#7118)
* Add colors and type and fix everywhere

* fix text.tsx

* Color and text adjustments

* Further tweaks

* Removed promotional gradient

Changed to pink

* Add new icons and tweak broken colors

* Kill shadows

Removes shadows from NFT cards, Pools and Tokens tables

* Update icons

Update filled and info icons to filled versions

* Update bag icon

Changed to fill style

* Change share icon

Changed to the new filled arrow

* Fix merge errors

* update tests

* Complete find and replace old colors

* Fix colors on pool pages

* Update index.test.tsx.snap

* fix header hover states

* update test

* Update connect button hover state

* Update styles design bash

* Update tests

* Update fonts

* fix buy button font weight

* update tests

* fix jumping input boxes

* lint

* lints

* update tests

* redo auth header

* fix issues

* fix snapshots

* use individual weights instead of variable for nicer $ signn

* update tests

* make dark mode glow distinct

* remove commented out code

* icons in react

* update textSecondary

* fix feedback

* port over token test fix

* lint

* fix: make popups appear above drawer and near top conditionally only when drawer is open

* Revert "fix: make popups appear above drawer and near top conditionally only when drawer is open"

This reverts commit 994697144374ae3fc0cdf9275bce538fda5fc8de.

---------

Co-authored-by: Callil Capuozzo <callil.capuozzo@gmail.com>
Co-authored-by: pp-hh-ii-ll <111304124+pp-hh-ii-ll@users.noreply.github.com>
Co-authored-by: Callil Capuozzo <callil@uniswap.org>
2023-08-24 17:14:24 -10:00

43 lines
1.5 KiB
TypeScript

import { WARNING_LEVEL } from 'constants/tokenSafety'
import { renderHook } from 'test-utils/render'
import { lightTheme } from 'theme/colors'
import { lightDeprecatedTheme } from 'theme/deprecatedColors'
import { useTokenWarningColor, useTokenWarningTextColor } from './useTokenWarningColor'
describe('Token Warning Colors', () => {
describe('useTokenWarningColor', () => {
it('medium', () => {
const { result } = renderHook(() => useTokenWarningColor(WARNING_LEVEL.MEDIUM))
expect(result.current).toEqual(lightTheme.surface3)
})
it('strong', () => {
const { result } = renderHook(() => useTokenWarningColor(WARNING_LEVEL.UNKNOWN))
expect(result.current).toEqual(lightDeprecatedTheme.deprecated_accentFailureSoft)
})
it('blocked', () => {
const { result } = renderHook(() => useTokenWarningColor(WARNING_LEVEL.BLOCKED))
expect(result.current).toEqual(lightTheme.surface3)
})
})
describe('useTokenWarningTextColor', () => {
it('medium', () => {
const { result } = renderHook(() => useTokenWarningTextColor(WARNING_LEVEL.MEDIUM))
expect(result.current).toEqual(lightDeprecatedTheme.deprecated_accentWarning)
})
it('strong', () => {
const { result } = renderHook(() => useTokenWarningTextColor(WARNING_LEVEL.UNKNOWN))
expect(result.current).toEqual(lightTheme.critical)
})
it('blocked', () => {
const { result } = renderHook(() => useTokenWarningTextColor(WARNING_LEVEL.BLOCKED))
expect(result.current).toEqual(lightTheme.neutral2)
})
})
})