-
-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(a19): respecting default standalone flag since angular 19
Added standalone false as default for mock-render and updated isStandalone method to handle angular 19+ default standalone behavior for components.
- Loading branch information
Showing
3 changed files
with
43 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { Component, VERSION } from '@angular/core'; | ||
|
||
import { isStandalone } from './func.is-standalone'; | ||
|
||
@Component({ | ||
selector: 'standalone', | ||
template: `<div> | ||
<h1>Angular 19 standalone</h1> | ||
</div>`, | ||
}) | ||
class StandaloneComponent {} | ||
|
||
describe('func.is-standalone', () => { | ||
describe('Angular Angular 19+ specific tests', () => { | ||
let originalVersion: { major: string }; | ||
const setVersionMajor = (major: number) => { | ||
Object.assign(VERSION, { major: major.toString() }); | ||
}; | ||
|
||
beforeAll(() => { | ||
originalVersion = { ...VERSION }; | ||
}); | ||
|
||
afterEach(() => { | ||
Object.assign(VERSION, originalVersion); | ||
}); | ||
|
||
it('should return true when standalone is undefined', () => { | ||
setVersionMajor(19); | ||
expect(isStandalone(StandaloneComponent)).toBeTruthy(); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters