aurelia / testing

Simplifies the testing of UI components by providing an elegant, fluent interface for arranging test setups along with a number of runtime debug/test helpers.
MIT License
40 stars 27 forks source link

Enhancement Request: Use pre-created view #17

Closed AStoker closed 6 years ago

AStoker commented 8 years ago

I'm working on trying to get tests back up and running on the UI-Virtualization plugin, and realized that at some point, we're trying to make sure a specific function was called with a pre-created element.
What the ComponentTester allows in the inView function is only a string. If we were able to pass an element in as well, then we could set up proper listeners in our tests.

martingust commented 8 years ago

@AStoker Sorry, I'm not sure I fully understand - what is the scenario where you want to make sure a function was called with a pre-created element?

AStoker commented 8 years ago

Well, I was looking at the virtual-repeat.spec.js file, where an element is created. This element is then registered on the container as a DOM.Element so that when the virtual repeat binding is executed, it uses element. Then, later on in the tests we want to make sure that functions such as getStrategy are called with the proper element (the element).
This might be a non issue, but I was thinking about possible future use cases as well where I wanted to specifically have an instance of the element to put spies on and use that element as the view in a test.

Alexander-Taran commented 6 years ago

Is this still relevant?

EisenbergEffect commented 6 years ago

@AStoker Thoughts?

AStoker commented 6 years ago

Oh gee, this is so far back. I'm going to go ahead and close this, as it's not a problem, and if it's been this long between initial request (and no other "me too's") then I think we'll be fine. If I come back up on this later, I'll reopen.