Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 2 additions & 0 deletions javascript/grid-ui/src/screens/Overview/Overview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ function Overview (): JSX.Element {
const sortProperties = {
'platformName': (a, b) => compareSlotStereotypes(a, b, 'platformName'),
'status': (a, b) => a.status.localeCompare(b.status),
'uri': (a, b) => a.uri.localeCompare(b.uri),
'browserName': (a, b) => compareSlotStereotypes(a, b, 'browserName'),
'browserVersion': (a, b) => compareSlotStereotypes(a, b, 'browserVersion'),
'slotCount': (a, b) => {
Expand All @@ -80,6 +81,7 @@ function Overview (): JSX.Element {
const sortPropertiesLabel = {
'platformName': 'Platform Name',
'status': 'Status',
'uri': 'URI',
'browserName': 'Browser Name',
'browserVersion': 'Browser Version',
'slotCount': 'Slot Count',
Expand Down
20 changes: 20 additions & 0 deletions javascript/grid-ui/src/tests/components/Overview.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,26 @@ describe('Overview component', () => {
}
})

it('sorts nodes by URI when selected', async () => {
render(
<MockedProvider mocks={mocks} addTypename={false}>
<Overview />
</MockedProvider>
)

await screen.findByText('http://192.168.1.10:4444')

const user = userEvent.setup()
const selectElement = screen.getByRole('combobox')
await user.click(selectElement)
await user.click(screen.getByText('URI'))

// After sorting by URI, node1 should appear before node2
const nodeUris = screen.getAllByText(/http:\/\/192\.168\.1\.\d+:4444/)
expect(nodeUris[0]).toHaveTextContent('http://192.168.1.10:4444')
expect(nodeUris[1]).toHaveTextContent('http://192.168.1.11:4444')
})

it('renders live view icon for node with VNC session', async () => {
render(
<MockedProvider mocks={mocks} addTypename={false}>
Expand Down