-
Notifications
You must be signed in to change notification settings - Fork 2
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
tests added for dashboard messages #92
Conversation
tests/test_messages.py
Outdated
|
||
def test_pre_authorization_message(self): | ||
pre_authorization_message = authorization.messages.get_pre_authorization_message(MOCK_USERNAME, FYLE_STOPLIGHT_URL) | ||
assert type(pre_authorization_message) is list |
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.
can we store the expected return value as fixture and assert with it?
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.
if you think asserting the whole message will be overkill, we can just check specific parts of it, for example
'text': 'Hey there *{}* :wave:'.format(user_name)
, you can check if text has the expected value
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.
will this work
for text_object in pre_authorization_message:
assert 'text' in text_object
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.
assert pre_authorization_message[0]['text'] == 'Hey there *fake_username* :wave:'
tests/test_messages.py
Outdated
|
||
def test_get_pre_authorization_message(self): | ||
pre_authorization_message = authorization.messages.get_pre_authorization_message(MOCK_USERNAME, MOCK_FYLE_OAUTH_URL) | ||
assert 'type' in pre_authorization_message[0] |
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.
same as 1st comment
tests/test_messages.py
Outdated
'url': MOCK_FYLE_OAUTH_URL | ||
} | ||
sent_back_reports_view = dashboard.messages.get_sent_back_reports_dashboard_view(mock_reports, 'INR') | ||
assert type(sent_back_reports_view) is list |
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.
same, can assert important keys that involves amount, count, etc
Tests added for authorization and dashboard of fyle slack UI.
Imrovement
dashboard's coverage -- 30% to 95%,
Total coverage -- 65% to 68%
Attesting the coverage report of files.