Skip to content

Commit f9e5bb6

Browse files
committed
fix(observability): use tenants creation url
resolve: #MAOBS-103 Signed-off-by: yjaaouane <[email protected]>
1 parent d2ac5ce commit f9e5bb6

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

packages/manager/apps/observability/src/__tests__/components/listing/tenants/top-bar/TenantsListTopbar.component.spec.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ describe('TenantsListTopbar', () => {
140140
});
141141

142142
describe('Navigation Behavior', () => {
143-
it('should navigate to addNew when button is clicked', () => {
143+
it('should navigate to creation when button is clicked', () => {
144144
// Act
145145
const { container } = render(<TenantsListTopbar />);
146146
const button = getButton(container);
@@ -149,7 +149,7 @@ describe('TenantsListTopbar', () => {
149149

150150
// Assert
151151
expect(mockNavigate).toHaveBeenCalledTimes(1);
152-
expect(mockNavigate).toHaveBeenCalledWith('addNew');
152+
expect(mockNavigate).toHaveBeenCalledWith('/metrics/tenants/creation');
153153
});
154154

155155
it('should handle multiple clicks', () => {
@@ -165,7 +165,7 @@ describe('TenantsListTopbar', () => {
165165

166166
// Assert
167167
expect(mockNavigate).toHaveBeenCalledTimes(3);
168-
expect(mockNavigate).toHaveBeenCalledWith('addNew');
168+
expect(mockNavigate).toHaveBeenCalledWith('/metrics/tenants/creation');
169169
});
170170
});
171171

packages/manager/apps/observability/src/components/listing/tenants/top-bar/TenantsListTopbar.component.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { ODS_BUTTON_VARIANT } from '@ovhcloud/ods-components';
77
import { ManagerButton } from '@ovh-ux/manager-react-components';
88

99
import { useObservabilityServiceContext } from '@/contexts/ObservabilityService.context';
10+
import { urls } from '@/routes/Routes.constants';
1011
import { IAM_ACTIONS } from '@/utils/iam.constants';
1112

1213
export default function TenantsListTopbar() {
@@ -16,7 +17,7 @@ export default function TenantsListTopbar() {
1617
const { selectedService, isLoading } = useObservabilityServiceContext();
1718

1819
const addNewTenant = () => {
19-
navigate('addNew');
20+
navigate(urls.tenantsCreation);
2021
};
2122

2223
return (

0 commit comments

Comments
 (0)