diff --git a/src/domains/DomainRow.tsx b/src/domains/DomainRow.tsx index e4c3c60d..2c6bdef9 100644 --- a/src/domains/DomainRow.tsx +++ b/src/domains/DomainRow.tsx @@ -48,13 +48,13 @@ export const DomainRow: FC = ({ domain, editDomainRedirects, def {redirects?.invalidShortUrlRedirect ?? } - + {isDefault && ( - + Redirects for default domain cannot be edited here.
Use config options or env vars directly on the server. diff --git a/test/domains/DomainRow.test.tsx b/test/domains/DomainRow.test.tsx index bd4e9357..98232aa9 100644 --- a/test/domains/DomainRow.test.tsx +++ b/test/domains/DomainRow.test.tsx @@ -17,10 +17,11 @@ describe('', () => { afterEach(() => wrapper?.unmount()); it.each([ - [ Mock.of({ domain: '', isDefault: true }), 1, 'domainEdit' ], - [ Mock.of({ domain: '', isDefault: false }), 0, '' ], - [ Mock.of({ domain: 'foo.com', isDefault: true }), 1, 'domainEditfoocom' ], - [ Mock.of({ domain: 'foo.bar.com', isDefault: true }), 1, 'domainEditfoobarcom' ], + [ Mock.of({ domain: '', isDefault: true }), 1, 'defaultDomainBtn' ], + [ Mock.of({ domain: '', isDefault: false }), 0, undefined ], + [ Mock.of({ domain: 'foo.com', isDefault: true }), 1, 'defaultDomainBtn' ], + [ Mock.of({ domain: 'foo.bar.com', isDefault: true }), 1, 'defaultDomainBtn' ], + [ Mock.of({ domain: 'foo.baz', isDefault: false }), 0, undefined ], ])('shows proper components based on the fact that provided domain is default or not', ( domain, expectedComps,