-
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.
- Loading branch information
1 parent
436c010
commit ebabf10
Showing
8 changed files
with
96 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@linode/manager": Added | ||
--- | ||
|
||
DBaaS GA Monitor tab ([#11105](https://github.com/linode/manager/pull/11105)) |
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
29 changes: 29 additions & 0 deletions
29
...es/manager/src/features/Databases/DatabaseDetail/DatabaseMonitor/DatabaseMonitor.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,29 @@ | ||
import { waitForElementToBeRemoved } from '@testing-library/react'; | ||
import * as React from 'react'; | ||
import { databaseFactory } from 'src/factories'; | ||
import { mockMatchMedia, renderWithTheme } from 'src/utilities/testHelpers'; | ||
import { DatabaseMonitor } from './DatabaseMonitor'; | ||
|
||
const loadingTestId = 'circle-progress'; | ||
|
||
beforeAll(() => mockMatchMedia()); | ||
|
||
describe('database monitor', () => { | ||
const database = databaseFactory.build({ id: 12 }); | ||
it('should render a loading state', async () => { | ||
const { getByTestId } = renderWithTheme( | ||
<DatabaseMonitor database={database} /> | ||
); | ||
// Should render a loading state | ||
expect(getByTestId(loadingTestId)).toBeInTheDocument(); | ||
}); | ||
|
||
it('should render CloudPulseDashboardWithFilters', async () => { | ||
const { getByTestId } = renderWithTheme( | ||
<DatabaseMonitor database={database} /> | ||
); | ||
expect(getByTestId(loadingTestId)).toBeInTheDocument(); | ||
await waitForElementToBeRemoved(getByTestId(loadingTestId)); | ||
expect(getByTestId('cloudpulse-time-duration')).toBeInTheDocument(); | ||
}); | ||
}); |
18 changes: 18 additions & 0 deletions
18
packages/manager/src/features/Databases/DatabaseDetail/DatabaseMonitor/DatabaseMonitor.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,18 @@ | ||
import * as React from 'react'; | ||
import { CloudPulseDashboardWithFilters } from 'src/features/CloudPulse/Dashboard/CloudPulseDashboardWithFilters'; | ||
import { Database } from '@linode/api-v4'; | ||
|
||
interface Props { | ||
database: Database; | ||
} | ||
|
||
export const DatabaseMonitor = ({ database }: Props) => { | ||
const databaseId = database?.id; | ||
const dbaasDashboardId = 1; | ||
return ( | ||
<CloudPulseDashboardWithFilters | ||
dashboardId={dbaasDashboardId} | ||
resource={databaseId} | ||
/> | ||
); | ||
}; |
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