-
Notifications
You must be signed in to change notification settings - Fork 367
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
upcoming: [M3-7609] - Placement Groups Landing Page (#10068)
* Initial commit - menu entry, routes and skeletons * Saving progress: table rows * Saving progress: Table data * Tests and cleanup * moar cleanup * Compliance col remove, styling and cleanup * Cleanup and changeset * Fix unit test * Update icon and limits * Feedback * Moar Feedback
- Loading branch information
1 parent
162f471
commit 9582ca1
Showing
15 changed files
with
580 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
packages/manager/.changeset/pr-10068-upcoming-features-1705596672088.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@linode/manager": Upcoming Features | ||
--- | ||
|
||
Placement Groups Landing Page ([#10068](https://github.com/linode/manager/pull/10068)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
packages/manager/src/assets/icons/entityIcons/placement-groups.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75 changes: 75 additions & 0 deletions
75
...nager/src/features/PlacementGroups/PlacementGroupsLanding/PlacementGroupsLanding.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
import * as React from 'react'; | ||
|
||
import { placementGroupFactory } from 'src/factories'; | ||
import { renderWithTheme } from 'src/utilities/testHelpers'; | ||
|
||
import { PlacementGroupsLanding } from './PlacementGroupsLanding'; | ||
|
||
const queryMocks = vi.hoisted(() => ({ | ||
usePlacementGroupsQuery: vi.fn().mockReturnValue({}), | ||
})); | ||
|
||
vi.mock('src/queries/placementGroups', async () => { | ||
const actual = await vi.importActual('src/queries/placementGroups'); | ||
return { | ||
...actual, | ||
usePlacementGroupsQuery: queryMocks.usePlacementGroupsQuery, | ||
}; | ||
}); | ||
|
||
describe('PlacementGroupsLanding', () => { | ||
it('renders loading state', () => { | ||
queryMocks.usePlacementGroupsQuery.mockReturnValue({ | ||
isLoading: true, | ||
}); | ||
|
||
const { getByRole } = renderWithTheme(<PlacementGroupsLanding />); | ||
|
||
expect(getByRole('progressbar')).toBeInTheDocument(); | ||
}); | ||
|
||
it('renders error state', () => { | ||
queryMocks.usePlacementGroupsQuery.mockReturnValue({ | ||
error: [{ reason: 'Not found' }], | ||
}); | ||
|
||
const { getByText } = renderWithTheme(<PlacementGroupsLanding />); | ||
|
||
expect(getByText(/not found/i)).toBeInTheDocument(); | ||
}); | ||
|
||
it('renders docs link and create button', () => { | ||
queryMocks.usePlacementGroupsQuery.mockReturnValue({ | ||
data: { | ||
data: [], | ||
results: 0, | ||
}, | ||
}); | ||
|
||
const { getByText } = renderWithTheme(<PlacementGroupsLanding />); | ||
|
||
expect(getByText(/create placement group/i)).toBeInTheDocument(); | ||
expect(getByText(/docs/i)).toBeInTheDocument(); | ||
}); | ||
|
||
it('renders placement groups', () => { | ||
queryMocks.usePlacementGroupsQuery.mockReturnValue({ | ||
data: { | ||
data: [ | ||
placementGroupFactory.build({ | ||
label: 'group 1', | ||
}), | ||
placementGroupFactory.build({ | ||
label: 'group 2', | ||
}), | ||
], | ||
results: 2, | ||
}, | ||
}); | ||
|
||
const { getByText } = renderWithTheme(<PlacementGroupsLanding />); | ||
|
||
expect(getByText(/group 1/i)).toBeInTheDocument(); | ||
expect(getByText(/group 2/i)).toBeInTheDocument(); | ||
}); | ||
}); |
Oops, something went wrong.