Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@
*/

export interface DomainConfigureMessages {
modal?: {
title?: string;
description?: string;
table?: {
empty_message?: string;
columns?: {
name?: string;
provider?: string;
};
actions?: {
add_provider_button_text?: string;
view_provider_button_text?: string;
};
title?: string;
description?: string;
table?: {
empty_message?: string;
columns?: {
name?: string;
provider?: string;
};
actions?: {
close_button_text?: string;
add_provider_button_text?: string;
view_provider_button_text?: string;
enable_provider_tooltip?: string;
disable_provider_tooltip?: string;
};
};
actions?: {
close_button_text?: string;
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,14 @@
*/

export interface DomainCreateMessages {
modal?: {
title?: string;
field?: {
label?: string;
placeholder?: string;
error?: string;
};
actions?: {
cancel_button_text?: string;
create_button_text?: string;
};
title?: string;
field?: {
label?: string;
placeholder?: string;
error?: string;
};
actions?: {
cancel_button_text?: string;
create_button_text?: string;
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,13 @@
*/

export interface DomainDeleteMessages {
modal?: {
title?: string;
description?: {
pending?: string;
verified?: string;
};
actions?: {
cancel_button_text?: string;
create_button_text?: string;
};
title?: string;
description?: {
pending?: string;
verified?: string;
};
actions?: {
cancel_button_text?: string;
delete_button_text?: string;
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,46 @@
*/

export interface DomainTableMessages {
header?: {
title?: string;
description?: string;
create_button_text?: string;
};
table?: {
empty_message?: string;
columns?: {
domain?: string;
status?: string;
domain_table?: {
header?: {
title?: string;
description?: string;
create_button_text?: string;
};
table?: {
empty_message?: string;
columns?: {
domain?: string;
status?: string;
};
actions?: {
configure_button_text?: string;
view_button_text?: string;
verify_button_text?: string;
delete_button_text?: string;
};
};
actions?: {
configure_button_text?: string;
view_button_text?: string;
verify_button_text?: string;
delete_button_text?: string;
notifications?: {
fetch_providers_error?: string;
fetch_domains_error?: string;
domain_create_success?: string;
domain_create_error?: string;
domain_verify_success?: string;
domain_verify_error?: string;
domain_verify_verification_failed?: string;
domain_delete_success?: string;
domain_delete_error?: string;
domain_associate_provider_success?: string;
domain_associate_provider_error?: string;
domain_delete_provider_success?: string;
domain_delete_provider_error?: string;
};
};
notifications?: {
fetch_providers_error?: string;
fetch_domains_error?: string;
domain_create_success?: string;
domain_create_error?: string;
domain_verify_success?: string;
domain_verify_error?: string;
domain_verify_verification_failed?: string;
domain_delete_success?: string;
domain_delete_error?: string;
domain_associate_provider_success?: string;
domain_associate_provider_error?: string;
domain_delete_provider_success?: string;
domain_delete_provider_error?: string;
shared?: {
domain_statuses?: {
pending?: string;
verified?: string;
failed?: string;
};
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,26 @@
*/

export interface DomainVerifyMessages {
modal?: {
title?: string;
txt_record_name?: {
label?: string;
description?: string;
};
txt_record_content?: {
label?: string;
description?: string;
};
verification_status?: {
label?: string;
description?: string;
pending?: string;
};
actions?: {
verify_button_text?: string;
delete_button_text?: string;
done_button_text?: string;
};
errors?: {
verification_failed?: string;
};
title?: string;
txt_record_name?: {
label?: string;
description?: string;
};
txt_record_content?: {
label?: string;
description?: string;
};
verification_status?: {
label?: string;
description?: string;
pending?: string;
};
actions?: {
verify_button_text?: string;
delete_button_text?: string;
done_button_text?: string;
};
errors?: {
verification_failed?: string;
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,58 +4,52 @@
* @internal
*/
export interface DomainTabCreateMessages {
modal: {
title?: string;
field?: {
label?: string;
placeholder?: string;
error?: string;
};
actions?: {
cancel_button_text?: string;
create_button_text?: string;
};
title?: string;
field?: {
label?: string;
placeholder?: string;
error?: string;
};
actions?: {
cancel_button_text?: string;
create_button_text?: string;
};
}

export interface DomainTabDeleteMessages {
modal: {
title?: string;
description?: {
pending?: string;
verified?: string;
};
actions?: {
cancel_button_text?: string;
create_button_text?: string;
};
title?: string;
description?: {
pending?: string;
verified?: string;
};
actions?: {
cancel_button_text?: string;
delete_button_text?: string;
};
}

export interface DomainTabVerifyMessages {
modal: {
title?: string;
txt_record_name?: {
label?: string;
description?: string;
};
txt_record_content?: {
label?: string;
description?: string;
};
verification_status?: {
label?: string;
description?: string;
pending?: string;
};
actions?: {
verify_button_text?: string;
delete_button_text?: string;
done_button_text?: string;
};
errors: {
verification_failed: string;
};
title?: string;
txt_record_name?: {
label?: string;
description?: string;
};
txt_record_content?: {
label?: string;
description?: string;
};
verification_status?: {
label?: string;
description?: string;
pending?: string;
};
actions?: {
verify_button_text?: string;
delete_button_text?: string;
done_button_text?: string;
};
errors?: {
verification_failed?: string;
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ export interface SsoProviderTableMessages {
edit_button_text?: string;
delete_button_text?: string;
remove_button_text?: string;
enabled_tooltip?: string;
disabled_tooltip?: string;
};
};
create_consent_modal?: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
} from '@/tests/utils/__mocks__/my-organization/domain-management/domain.mocks';
import { renderWithProviders } from '@/tests/utils/test-provider';
import { mockCore, mockToast } from '@/tests/utils/test-setup';
import type { DomainTableProps } from '@/types/my-organization/domain-management/domain-table-types';

mockToast();
const { initMockCoreClient } = mockCore();
Expand Down Expand Up @@ -746,23 +747,20 @@ describe('DomainTable', () => {

describe('customMessages', () => {
describe('when custom header title is provided', () => {
it('should render component with customMessages prop', async () => {
renderWithProviders(
<DomainTable
{...createMockDomainTableProps({
customMessages: {
header: {
title: 'Custom Domain Title',
},
},
})}
/>,
);
it('should override header title', async () => {
const customMessages: DomainTableProps['customMessages'] = {
domain_table: {
header: {
title: 'Custom Domain Title',
},
},
};

renderWithProviders(<DomainTable {...createMockDomainTableProps({ customMessages })} />);

await waitForComponentToLoad();

expect(screen.getByRole('table')).toBeInTheDocument();
expect(screen.getByText(/header\.title|Custom Domain Title/i)).toBeInTheDocument();
expect(screen.getByText('Custom Domain Title')).toBeInTheDocument();
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,16 +94,13 @@ describe('DomainConfigureProvidersModal', () => {

it('should render with custom messages', () => {
const customMessages = {
modal: {
title: 'Custom Title - {domain}',
description: 'Custom description for {domain}',
},
title: 'Custom Title - {domain}',
description: 'Custom description for {domain}',
};
const props = createMockDomainConfigureProvidersModalProps({ customMessages });
renderWithProviders(<DomainConfigureProvidersModal {...props} />);

// The title should still use the mocked translator
expect(screen.getByText('title')).toBeInTheDocument();
expect(screen.getByText(/Custom Title/)).toBeInTheDocument();
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -479,10 +479,8 @@ describe('DomainCreateModal', () => {
translatorKey="custom.domain.create.modal"
className="test-class"
customMessages={{
modal: {
title: 'Custom Title',
field: { label: 'Custom Label' },
},
title: 'Custom Title',
field: { label: 'Custom Label' },
}}
schema={{
domainUrl: {
Expand Down
Loading