Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Accept subscribable on rxLet input #1657

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

AlirezaEbrahimkhani
Copy link

resolves #1541

@github-actions github-actions bot added </> Template @rx-angular/template related 🛠️ CDK CDK related labels Dec 8, 2023
Copy link
Member

@edbzn edbzn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, thanks for the PR @Rush, I left a comment for adding a test case. Would you mind creating it?

@eneajaho
Copy link
Member

Hello @AlirezaEbrahimkhani Anything you need to move this PR forward?

@AlirezaEbrahimkhani
Copy link
Author

AlirezaEbrahimkhani commented Dec 20, 2023

@edbzn @eneajaho
I did the review.

@AlirezaEbrahimkhani
Copy link
Author

Could you please review this PR?
@eneajaho @edbzn

Comment on lines +67 to +71
it('should display value from Subscribable', fakeAsync(() => {
letDirectiveTestComponent.value$ = 42;
fixtureLetDirectiveTestComponent.detectChanges();
expect(componentNativeElement.textContent.trim()).toBe('42');
}));
Copy link
Member

@hoebbelsB hoebbelsB Jan 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this test doesn't test the subscribable. You are essentially overwriting the BehaviorSubject with a number which is getting rendered.

Instead, you should provide an actual Subscribable.

Suggested change
it('should display value from Subscribable', fakeAsync(() => {
letDirectiveTestComponent.value$ = 42;
fixtureLetDirectiveTestComponent.detectChanges();
expect(componentNativeElement.textContent.trim()).toBe('42');
}));
it('should display value from Subscribable', () => {
letDirectiveTestComponent.value$ = {
subscribe: ({ next }) => {
next(42)
}
};
fixtureLetDirectiveTestComponent.detectChanges();
expect(componentNativeElement.textContent.trim()).toBe('42');
});

Copy link
Member

@hoebbelsB hoebbelsB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as pointed out in the other comment, please adjust the spec so that it actually tests for a subscribable input

@hoebbelsB
Copy link
Member

@AlirezaEbrahimkhani any update? :-)

@AdrianRomanski
Copy link
Contributor

@hoebbelsB I'll make it from the scratch on my fork

@hoebbelsB
Copy link
Member

close in favor of #1721

thank u @AlirezaEbrahimkhani for the initial contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🛠️ CDK CDK related </> Template @rx-angular/template related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rxLet: Should accept Subscribable, not only ObservableInput
5 participants