Commit Graph

133 Commits

Author SHA1 Message Date
Joe Tsang
aec94f0354
test: update test for network parameters table (#300) (#408)
* test: update test for network parameters table (#300)

* fix: lint
2022-05-23 10:32:05 +01:00
Sam Keen
34502a7c7f
frontend-monorepo-436 Env var files 'devent' typo (#437) 2022-05-23 09:51:19 +01:00
Sam Keen
e0bcfe7bbe
Feat/231-explorer-infinite-loading-blocks (#306)
* Making a start with react-window-infinite-loader for the blocks infinite scrolling

* WIP block explorer infinte scroll

* WIP pairing

* pairing tidying

* Applied refetch url params more cleanly, moved useFetch to react-helpers lib

* Add notice of new blocks created since page load, some cleanup of blocks-infinite-list.tsx component

* Attempting a refresh of the 'new blocks' value in blocks-refetch.tsx

* Correctly updating state based on previous value

* Update libs/react-helpers/src/hooks/use-fetch.ts

Co-authored-by: Matthew Russell <mattrussell36@gmail.com>

* Update libs/react-helpers/src/hooks/use-fetch.ts

Co-authored-by: Matthew Russell <mattrussell36@gmail.com>

* Update apps/explorer/src/app/components/blocks/blocks-refetch.tsx

Co-authored-by: Matthew Russell <mattrussell36@gmail.com>

* Cleanup from convos and PR

* Prettier formatting

* struggling with websocket tests

* struggling with websocket tests

* Progress on websocket tests for blocks-refetch.tsx

* Tests for blocks-refetch

* Tests for blocks-infinite-list

* Scroll test for blocks-infinite-list

* Defined NOOP in blocks-infinite-list.tsx

* Separate web sockets for each test

* Separate web sockets for each test

* Tweaked e2e tests to account for blocks taking longer to load

* fix tests

* Removed nx knowledge of empty simple-trading-app-e2e for now

* mock at use fetch level instead of at fetch level

* fix edge cases and add further tests

* fix failing e2e tests

* rename test

* Update apps/explorer-e2e/src/support/pages/blocks-page.ts

* Update apps/explorer-e2e/src/support/pages/blocks-page.ts

* rename

* test: use explicit wait for rather than times

* style: remove console

* test: correct env file

* Revert "test: correct env file"

This reverts commit d01d3cfa5e.

* think env var is incorrect

* correct env file

* fix flakiness

* add minor wait for test flakiness

* longer timeout

Co-authored-by: Dexter <dexter.edwards93@gmail.com>
Co-authored-by: Matthew Russell <mattrussell36@gmail.com>
2022-05-13 12:03:08 +01:00
m.ray
d03e4cf785
Feat/300 network parameters table (#333)
* network parameters table with key value rows and syntax blobs only for json values

* inline row not for syntax

* add unit test for network param table

* add cypress test to verify if values are non-empty

* remove some comments

* rename formatNumber method to addDecimalsFormatNumber and simplify formatNumber

* remove duplicate expect line

* use AsyncRenderer and sort params asc

* refactor and add extra tests to check ordering and loading cases

* format big number params with addDecimals formatNumber

* Update apps/explorer/src/app/routes/network-parameters/network-parameters.tsx

Co-authored-by: Dexter Edwards <dexter.edwards93@gmail.com>

* capitalize and refactor tests

* missing ; caused formatting to fail

Co-authored-by: madalinaraicu <“madalina@raygroup.uk”>
Co-authored-by: Dexter Edwards <dexter.edwards93@gmail.com>
2022-05-04 18:15:54 +03:00
Joe Tsang
48f66a9ce8
Test/fix failing regex with comma (#329)
* Update regex to include commas

* Add force true to clicking on transaction
2022-04-29 11:55:55 +01:00
Sam Keen
2b910aa04c
Feat/272 syntax highlighter from explorer to ui-toolkit and feat/216 added light theme and feat/283 add to token (#286)
* Moved syntax highlighter from explorer to ui-toolkit

* Update libs/ui-toolkit/src/components/syntax-highlighter/syntax-highlighter.stories.tsx

Co-authored-by: Dexter Edwards <dexter.edwards93@gmail.com>

* Added a light theme for syntax highlighter, added the styling for syntax highlighter to our custom classes

* Suboptimal but successful way of ensuring styling is applied to syntax highlighter

* Styling syntax highlighter with scss

* Fix failing test

* Back to applying styling via custom plugin, but with a wrapper on the syntax highlighter ensuring Tailwind doesn't cull the classes

* Preferred class name

* prettier formatting

Co-authored-by: Dexter Edwards <dexter.edwards93@gmail.com>
Co-authored-by: Joe <joe@vega.xyz>
2022-04-29 10:46:31 +01:00
Joe Tsang
de4c5499b9
Check for 2dp on total staked (#308)
* Check for 2dp on total staked

* Update apps/explorer-e2e/src/support/pages/home-page.ts

Co-authored-by: Dexter Edwards <dexter.edwards93@gmail.com>

Co-authored-by: Dexter Edwards <dexter.edwards93@gmail.com>
2022-04-28 15:36:42 +01:00
Joe Tsang
753cff95b9
Test/249 convert js files to ts (#255)
* Explorer-e2e files changed to ts

* Files on trading app converted

* Fix type error and update Cypress

* Remove Jquery type

* Update Cypress version in package.json
2022-04-14 09:33:20 +01:00
Joe Tsang
7aea742677
Test added for stats page (#199)
* Test added for stats page

* Removed implicit waits

* Switch to use Cypress env

* Fix lint error
2022-04-13 09:31:23 +01:00
Matthew Russell
04872522d6
Task/229 Stub api in trading e2e (#211)
* add fixture for markets query

* stub graphql requests

* re-add assertion for tx hash, stub command/sync requests

* refactor to get tests to run with trading page mocked queries

* add test wallet credentials

* split up markets page from trading page

* add portfolio page feature, add market page scenarios

* move hasOperationName helper to support/index

* fix home-page.feature

* fix missing feature step

* Minor changes to BDD steps

* Use in object syntax to get better type safety on hasOperationName helper function

* remove bypass placing orders env var and usage in tests

* use UI_Trading_Test wallet publick key in command/sync mock

* move public key to cypress env

* replace fixtures with generator functions

* colocate query generators with queries

* add custom commands, add index files

* fix dodgy merge, remove duplicate market page feature

* make tsconfig for cypress lib match

* update tsconfig for explorer e2e so commands using merge work

* revert trading step to js

Co-authored-by: Joe <joe@vega.xyz>
2022-04-12 12:04:26 +01:00
Joe Tsang
446f7b13d8
Additional tests in mobile resolution (#225)
* Additional tests in mobile resolution

* Update toggle variable name
2022-04-11 18:09:54 +01:00
Joe Tsang
5cd35704ff
Tests for next/previous block feature (#209) 2022-04-06 16:03:22 +01:00
Joe Tsang
a459793f09
Task/Updated tests to pass when there are no transactions (#145)
* Updated tests to pass when there are no txs

* Add slack command to send messages to slack

* Re add library for Cypress

* Resolved PR comments

* Added TODOs for clarity

* Increase wait for block to update

* Increase to 3 seconds

Co-authored-by: Matthew Russell <mattrussell36@gmail.com>
2022-04-04 18:20:33 +01:00
Joe Tsang
205f4124f1
Test/deal ticket tests (#161)
* scaffold dealticket package, remove trading views from react-helpers

* add deal ticket component, add intent utils, expand dialog and form group styles

* add splash component, show market not found message if market doesnt exist

* tidy up error handling

* add handleError method for vega tx hook

* add better testname for provider test, flesh out tests a bit more for deal ticket

* Add unit tests for useVegaTransaction and useOrderSubmit hooks

* add wrapper component for order dialog styles

* add vega styled loader to ui toolkit and use in order dialog

* add title prop to order dialog

* split limit and market tickets into own files

* add button radio component

* revert dialog styles

* move splash component to ui-toolkit, add story

* convert intent to enum

* Make button always type=button unless type prop is passed

* inline filter logic for tif selector

* add date-fns, add datetime to helpers

* add order types to wallet package, make price undefined if order type is market

* use enums in deal ticket logic

* tidy up order state by moving submit and transaction hooks out of deal ticket

* add comment for dialog styles

* remove decimal from price input

* add types package, delete old generated types from trading project

* rename types package to graphql

* update generate command to point to correct locations

* fix use order submit test

* BDD and navigation tests passing

* Remove commented steps

* Steps up to placing order

* Date picker and date-fns update

* Vega connector wallet tests

* Passing up to request sent, updated date picker

* Tests for sell orders and errors

* Update market feature

* Fix failing tests

* Update wallet login

* Readded tx hash assertion and remaining tests

* Add CI wallet import

* Update .github/workflows/cypress.yml

Co-authored-by: Dexter Edwards <dexter.edwards93@gmail.com>

* Resolved PR comments

* Fix yaml error

* Attempt to fix failing tests in CI

* Run Cypress in Chrome

* Add reload if public key error displayed

* Fix wallet name

* Add force click and waits

* Increase timeout for deal ticket page

* Removed network list from yaml and using input error id

* Increase timeout to 8 seconds

* Re add deleted test id

Co-authored-by: Matthew Russell <mattrussell36@gmail.com>
Co-authored-by: Dexter Edwards <dexter.edwards93@gmail.com>
2022-04-04 16:11:27 +01:00
Dexter
5c6939d9c8 fix all lint warnings 2022-04-01 10:53:03 +01:00
Dexter Edwards
e4578a198f
Chore/sentry (#163)
* begin adding sentry

* add sentry webpack config

* rename environment variable

* make sourcemaps work for sentry

* set environmenet based on vega environment

* rename envs

* remove throw error button
2022-03-29 18:29:29 +01:00
sam-keen
e2a61d26ad Proper way to get environment variables, and hoisted obtaining the env vars to the consumer of the stats manager 2022-03-24 14:58:24 +00:00
Joe Tsang
56b6933ea3
Additional search tests added (#124) 2022-03-24 09:48:27 +00:00
Matthew Russell
6ad2a7676e
Feat/84 Order list (#89)
* scaffold dealticket package, remove trading views from react-helpers

* add deal ticket component, add intent utils, expand dialog and form group styles

* add splash component, show market not found message if market doesnt exist

* tidy up error handling

* add handleError method for vega tx hook

* add better testname for provider test, flesh out tests a bit more for deal ticket

* Add unit tests for useVegaTransaction and useOrderSubmit hooks

* add wrapper component for order dialog styles

* add vega styled loader to ui toolkit and use in order dialog

* add title prop to order dialog

* add button radio component

* revert dialog styles

* move splash component to ui-toolkit, add story

* convert intent to enum

* add date-fns, add datetime to helpers

* add order types to wallet package, make price undefined if order type is market

* tidy up order state by moving submit and transaction hooks out of deal ticket

* add types package, delete old generated types from trading project

* rename types package to graphql

* add order list container and order list component

* add test setup for useOrders

* add test for use-orders hook

* tidy unnecessary diff

* regen types and use them in order-list, also change to use applytransaction hook for orderlist grid

* make order table columns resizable

* make market table not have highlightable cells, use splash for orders errors and loading states, unit test for orderlist container

* add tests for order list table

* show rejection reason and expires at depending on status and tif

* add decimal places to query

* only update row if data has changed, add test coverage

* add setup tests file to avoid importing jest-dom for every test, add async-renderer component to handle fetch ui logic

* install all of lodash but import individually to get tree shaking

* add setup tests file for orderlist package

* add missing fields to use orders spec mock order

* fix act warnings in index page test

* fix casing of app import

* remove react-singleton-hook, simplify side formatting

* fix linting errors
2022-03-23 12:08:10 -07:00
Sam Keen
05d53bbf4c
106 - migrate mainnet stats to monorepo (#107)
* Initial commit of generated mainnet-stats directory

* Migration partly complete

* Migration complete

* Vega logo now in ui toolkit

* Specified a port that stops conflicts with other e2e tests

* Extra config for swapping to port that stops conflicts with other e2e tests. Also file name case change

* Adding the Cypress project ID to allow recording

* fix test

* Mainnet stats manager moved into library

* Mainnet stats project now importing manager element from lib

* Block Explorer has mainnet stats on home route

* Styling tweak to stop mainnet stats tables trying to match heights

* Spacing alignment tweaks

* Changing header text and tests to align with other branches

* Correct header test for mainnet-stats app

* Correct h3 test for mainnet-stats app

* Fix linting issue

* fix casing issue for CI

* Corrected mistake in merge

Co-authored-by: Dexter <dexter.edwards93@gmail.com>
2022-03-23 17:40:15 +00:00
Dexter Edwards
ae37f76b1c
Search implementation (#97)
* make titles look prettier

* link to parties from transactions table

* render what data is found conditionally

* more syntax highlighting

* re-jig file orders

* remove footer component for now

* add subheading component

* adjust column layout

* Style up header

* enable ligatures

* change env files

* fix error if data is null

* show governance header even if there is no data

* remove dead css

* add dark theme for block explorer

* use memo on parties submit

* remove some css from header

* basic search implementation

* allow passing classNames to form group

* add tests for form group

* add form-grpup stories

* bad rebase fixes

* add link

* tidy up tests

* fix tests

* tidy up env files

* final test fixes

* switch order of classes

* fix test id

* force build for testing

* rename file for linting

* add tests for header component

* rename export

* input error tests

* use descriptive function names as per PR comment

* fix casing issue for CI

* handle empty state

* make query easier to understand
2022-03-23 09:57:51 +00:00
Joe Tsang
34959075c2
Test/block page (#91)
* Added block page and validator test

* Transaction details and network param test added

* Add test id for styling change

* Changed test id names
2022-03-21 13:01:51 +00:00
Dexter Edwards
7b4437f407
regenerate based on new API client (#86)
* regenerate based on new API client

* lint

* run projects on different ports
2022-03-17 09:09:48 +00:00
Joe
1fa63d2260 Remove Cypress action 2022-03-10 12:05:41 +00:00
Dexter
6961c7107c a bunch of different env 2022-03-10 12:05:41 +00:00
Dexter
cbef551312 fix environement config 2022-03-10 12:05:41 +00:00
Joe
615562af54 Remaining tests added and passing 2022-03-07 17:18:15 +00:00
Joe
de80be7196 Rebase and test for txs page 2022-03-07 17:18:15 +00:00
Joe
ac58037ba3 Main pages created 2022-03-07 17:18:15 +00:00
Joe
aa0a88cb04 Base page and few more 2022-03-07 17:18:15 +00:00
Joe
6a8778becd Fix for .env not picked up and Cypress update 2022-03-02 16:25:48 +00:00
jtsang586
b246a92233 BDD set up 2022-03-02 16:25:48 +00:00
Dexter
159cdb6023 migrate stuff into new NX 2022-02-23 08:53:57 +00:00