diff --git a/lint/src/rules/html/themed-component-usages.ts b/lint/src/rules/html/themed-component-usages.ts
index 6184805a2b1..2ba2e0ff33e 100644
--- a/lint/src/rules/html/themed-component-usages.ts
+++ b/lint/src/rules/html/themed-component-usages.ts
@@ -20,6 +20,10 @@ export default {
}
},
create(context: any) {
+ if (context.getFilename().endsWith('.spec.ts')) {
+ return {};
+ }
+
return {
[`Element$1[name = /^${DISALLOWED_THEME_SELECTORS}/]`](node: any) {
context.report({
diff --git a/lint/test/rules/themed-component-usages.spec.ts b/lint/test/rules/themed-component-usages.spec.ts
index 2f5dbcec203..4ab3588ef62 100644
--- a/lint/test/rules/themed-component-usages.spec.ts
+++ b/lint/test/rules/themed-component-usages.spec.ts
@@ -137,6 +137,36 @@ describe('themed-component-usages (HTML)', () => {
`,
},
+ {
+ name: fixture('src/test.ts'),
+ code: `
+@Component({
+ template: ''
+})
+class Test {
+}
+ `,
+ },
+ {
+ name: fixture('src/test.spec.ts'),
+ code: `
+@Component({
+ template: ''
+})
+class Test {
+}
+ `,
+ },
+ {
+ filename: fixture('src/test.spec.ts'),
+ code: `
+@Component({
+ template: ''
+})
+class Test {
+}
+ `,
+ },
],
invalid: [
{
diff --git a/src/app/my-dspace-page/collection-selector/collection-selector.component.spec.ts b/src/app/my-dspace-page/collection-selector/collection-selector.component.spec.ts
index ae0284da177..aa7d8aa957d 100644
--- a/src/app/my-dspace-page/collection-selector/collection-selector.component.spec.ts
+++ b/src/app/my-dspace-page/collection-selector/collection-selector.component.spec.ts
@@ -146,7 +146,7 @@ describe('CollectionSelectorComponent', () => {
scheduler = getTestScheduler();
fixture = TestBed.overrideComponent(CollectionSelectorComponent, {
set: {
- template: '',
+ template: '',
},
}).createComponent(CollectionSelectorComponent);
component = fixture.componentInstance;
diff --git a/src/app/search-page/configuration-search-page.component.spec.ts b/src/app/search-page/configuration-search-page.component.spec.ts
index 2467e5ada42..6896faa25a2 100644
--- a/src/app/search-page/configuration-search-page.component.spec.ts
+++ b/src/app/search-page/configuration-search-page.component.spec.ts
@@ -20,10 +20,10 @@ const QUERY = 'test query';
@Component({
template: `
-
-
+
`,
})
class HostComponent {