Add hysteresis and EMA to ping to avoid flickering network badge (#7197)
* Don't use WEAK and yellow * fmt && lint && tsc * Fix up the rebase & dark mode colors * Update src/hooks/useNetworkStatus.tsx Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com> * Change Weak to Ok * Change Connected to Strong * fmt * Sync selectors for start sketch * Remove unused test-util brought back in a rebase * Align the other OKs * Add an else statement to overallState --------- Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
This commit is contained in:
@ -14,8 +14,10 @@ test.describe('Test network related behaviors', () => {
|
||||
'simulate network down and network little widget',
|
||||
{ tag: '@skipLocalEngine' },
|
||||
async ({ page, homePage }) => {
|
||||
const networkToggleConnectedText = page.getByText('Connected')
|
||||
const networkToggleWeakText = page.getByText('Network health (Weak)')
|
||||
const networkToggleConnectedText = page.getByText(
|
||||
'Network health (Strong)'
|
||||
)
|
||||
const networkToggleWeakText = page.getByText('Network health (Ok)')
|
||||
|
||||
const u = await getUtils(page)
|
||||
await page.setBodyDimensions({ width: 1200, height: 500 })
|
||||
@ -98,8 +100,10 @@ test.describe('Test network related behaviors', () => {
|
||||
{ tag: '@skipLocalEngine' },
|
||||
async ({ page, homePage, toolbar, scene, cmdBar }) => {
|
||||
const networkToggle = page.getByTestId('network-toggle')
|
||||
const networkToggleConnectedText = page.getByText('Connected')
|
||||
const networkToggleWeakText = page.getByText('Network health (Weak)')
|
||||
const networkToggleConnectedText = page.getByText(
|
||||
'Network health (Strong)'
|
||||
)
|
||||
const networkToggleWeakText = page.getByText('Network health (Ok)')
|
||||
|
||||
const u = await getUtils(page)
|
||||
await page.setBodyDimensions({ width: 1200, height: 500 })
|
||||
@ -282,8 +286,10 @@ profile001 = startProfile(sketch001, at = [12.34, -12.34])
|
||||
{ tag: ['@desktop', '@skipLocalEngine'] },
|
||||
async ({ page, homePage, scene, cmdBar, toolbar, tronApp }) => {
|
||||
const networkToggle = page.getByTestId('network-toggle')
|
||||
const networkToggleConnectedText = page.getByText('Connected')
|
||||
const networkToggleWeakText = page.getByText('Network health (Weak)')
|
||||
const networkToggleConnectedText = page.getByText(
|
||||
'Network health (Strong)'
|
||||
)
|
||||
const networkToggleWeakText = page.getByText('Network health (Ok)')
|
||||
|
||||
if (!tronApp) {
|
||||
fail()
|
||||
|
||||
Reference in New Issue
Block a user