Skip to content

Commit

Permalink
test: reproduce #422 (#423)
Browse files Browse the repository at this point in the history
Closes #422
  • Loading branch information
timdeschryver authored Dec 9, 2023
1 parent d5486f1 commit 30bff7b
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 11 deletions.
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@
"prepare": "git config core.hookspath .githooks"
},
"dependencies": {
"@angular/animations": "17.0.2",
"@angular/animations": "17.0.3",
"@angular/cdk": "17.0.0",
"@angular/common": "17.0.2",
"@angular/compiler": "17.0.2",
"@angular/core": "17.0.2",
"@angular/common": "17.0.3",
"@angular/compiler": "17.0.3",
"@angular/core": "17.0.3",
"@angular/material": "17.0.0",
"@angular/platform-browser": "17.0.2",
"@angular/platform-browser-dynamic": "17.0.2",
"@angular/router": "17.0.2",
"@angular/platform-browser": "17.0.3",
"@angular/platform-browser-dynamic": "17.0.3",
"@angular/router": "17.0.3",
"@ngrx/store": "17.0.0-rc.0",
"@nx/angular": "17.1.1",
"@testing-library/dom": "^9.0.0",
Expand All @@ -54,9 +54,9 @@
"@angular-eslint/schematics": "17.0.1",
"@angular-eslint/template-parser": "17.0.1",
"@angular/cli": "~17.0.0",
"@angular/compiler-cli": "17.0.2",
"@angular/forms": "17.0.2",
"@angular/language-service": "17.0.2",
"@angular/compiler-cli": "17.0.3",
"@angular/forms": "17.0.3",
"@angular/language-service": "17.0.3",
"@nx/eslint-plugin": "17.1.1",
"@nx/jest": "17.1.1",
"@nx/node": "17.1.1",
Expand Down
10 changes: 9 additions & 1 deletion projects/testing-library/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,15 @@
{
"files": ["*.ts"],
"rules": {
"@typescript-eslint/ban-ts-comment": "off"
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_",
"caughtErrorsIgnorePattern": "^_"
}
]
}
},
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { Component, ElementRef } from '@angular/core';
import { NgIf } from '@angular/common';
import { render } from '../../src/public_api';

test('declaration specific dependencies should be available for components', async () => {
@Component({
selector: 'atl-test',
standalone: true,
template: `<div>Test</div>`,
})
class TestComponent {
constructor(_elementRef: ElementRef) {}
}

await expect(async () => await render(TestComponent)).not.toThrow();
});

test('standalone directives imported in standalone components', async () => {
@Component({
selector: 'atl-test',
standalone: true,
imports: [NgIf],
template: `<div *ngIf="true">Test</div>`,
})
class TestComponent {}

await render(TestComponent);
});

0 comments on commit 30bff7b

Please sign in to comment.