From 4986dbcb91eb5cca531e92f59833e4c26d77e48d Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Tue, 7 Dec 2021 20:41:07 +0100 Subject: [PATCH] Fixed tests --- src/domains/DomainRow.tsx | 4 ++-- test/domains/DomainRow.test.tsx | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) 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,