Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -492,8 +492,10 @@ export default {
filter(value, search, _item) {
if (this.isPinned(value)) {
return true
} else {
} else if (value) {
return value.toString().indexOf(search.toUpperCase()) >= 0
} else {
return false
}
},
packetChanged(event) {
Expand Down
9 changes: 4 additions & 5 deletions playwright/tests/bucket-explorer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

// @ts-check
import { test, expect } from './fixture'
import { format } from 'date-fns'

test.use({
toolPath: '/tools/bucketexplorer',
Expand Down Expand Up @@ -185,7 +184,7 @@ test('upload and delete', async ({ page, utils }) => {
await expect(page.locator('[data-test="file-path"]')).toHaveText(
'/ DEFAULT / tmp /',
)
await utils.sleep(5000) // Ensure the table is rendered before getting the count
await page.locator('tbody> tr').first().waitFor()
let count = await page.locator('tbody > tr').count()

// Note that Promise.all prevents a race condition
Expand Down Expand Up @@ -264,7 +263,7 @@ test('navigate logs and tools bucket', async ({ page, utils }) => {
)
await expect(page).toHaveURL(/.*\/tools\/bucketexplorer\/logs%2FDEFAULT%2F/)
// Ensure the log files have the correct dates
let date = format(new Date(), 'yyyyMMdd')
let date = new Date().toISOString().split('T')[0].replace(/-/g, '')
await page.getByRole('cell', { name: 'raw_logs' }).click()
await page.getByRole('cell', { name: 'tlm' }).click()
await page.getByRole('cell', { name: 'INST', exact: true }).click()
Expand Down Expand Up @@ -335,7 +334,7 @@ test('auto refreshes to update files', async ({
await page.locator('[data-test="upload-file-submit-btn"]').click()

// The second tab shouldn't have refreshed yet, so the file shouldn't be there
await utils.sleep(5000) // Ensure the table is rendered before checking
await page.locator('tbody> tr').first().waitFor()
await expect(
pageTwo.getByRole('cell', { name: 'package2.json' }),
).not.toBeVisible()
Expand All @@ -352,7 +351,7 @@ test('auto refreshes to update files', async ({
await pageTwo.locator('.v-dialog').press('Escape')

// Second tab should auto refresh in 1s and then the file should be there
await utils.sleep(5000) // Ensure the table is rendered before checking
await page.locator('tbody> tr').first().waitFor()
await expect(
pageTwo.getByRole('cell', { name: 'package2.json' }),
).toBeVisible()
Expand Down
14 changes: 12 additions & 2 deletions playwright/tests/packet-viewer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,13 @@ test('changes the polling rate', async ({ page, utils }) => {
.locator('.v-dialog [data-test=refresh-interval] input')
.press('Enter')
await page.locator('.v-dialog').press('Escape')
const received = parseInt(await page.inputValue('tr:has-text("RECEIVED_COUNT") input'))
const received = parseInt(
await page.inputValue('tr:has-text("RECEIVED_COUNT") input'),
)
await utils.sleep(7000)
const received2 = parseInt(await page.inputValue('tr:has-text("RECEIVED_COUNT") input'))
const received2 = parseInt(
await page.inputValue('tr:has-text("RECEIVED_COUNT") input'),
)
expect(received2 - received).toBeLessThanOrEqual(6) // Allow slop
expect(received2 - received).toBeGreaterThanOrEqual(4) // Allow slop
// Set it back
Expand All @@ -193,6 +197,12 @@ test('displays formatted items with units by default', async ({
await matchItem(page, 'TEMP1', /^-?\d+\.\d{3}\s\S$/)
})

test('searches on packets without data', async ({ page, utils }) => {
await utils.selectTargetPacketItem('EXAMPLE', 'STATUS')
await page.locator('[data-test="search"] input').fill('STRING')
await expect.poll(() => page.locator('tbody > tr').count()).toEqual(1)
})

test('displays formatted items with units', async ({ page, utils }) => {
await utils.selectTargetPacketItem('INST', 'HEALTH_STATUS')
await page.locator('[data-test="search"] input').fill('TEMP1')
Expand Down
Loading