-
Notifications
You must be signed in to change notification settings - Fork 14.5k
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
Fix auto refresh for graph view #26926
Conversation
tests/www/views/test_views_tasks.py
Outdated
assert resp.status_code == 200 | ||
payload = resp.json | ||
for v in payload.values(): | ||
assert v.pop('updated_at') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a way to mock the server_default, for updated_at
so I can assert the entire response ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I pushed a commit to do this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @uranusjr, much cleaner this way. I naively froze time on the test, which had no effect since fixture init happens before 🤦♂️
055d680
to
ec79721
Compare
ec79721
to
8e4bc93
Compare
@@ -434,11 +434,10 @@ function handleRefresh() { | |||
// only refresh if the data has changed | |||
if (prevTis !== tis) { | |||
// eslint-disable-next-line no-global-assign |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can get rid of this line now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure about the updated_at
mock but this looks good to me.
* Fix auto refresh for graph view * Add task_instances view test * Use freezegun to mock datetime Co-authored-by: Tzu-ping Chung <[email protected]> (cherry picked from commit 6462292)
* Fix auto refresh for graph view * Add task_instances view test * Use freezegun to mock datetime Co-authored-by: Tzu-ping Chung <[email protected]> (cherry picked from commit 6462292)
solves: #26901
#26554 introduced a proper way to set the
json_provider_class
. As a result the/object/task_instances
endpoint now returns ajson/application
content type instead oftext/html
which is already parsed in the front. Explicitly callingJSON.parse
is not necessary anymorehandleRefresh
.Old Response:
Current response:
I figured adding a test for the
/object/task_instances
view wouldn't hurt.