Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Enhancement/move modal to inline #982

Merged

Conversation

manaswinidas
Copy link
Contributor

Fixes #377
Progress in work of #958 and #973

Changes proposed in this pull request:

one

cc @jkleinsc @jglovier

@jkleinsc
Copy link
Member

@dasManaswini - I took a look at the failing tests and I realized the tests are failing because of the change you made. The reason is that the tests are expecting the modal to appear when the patient is saved.
The following tests are expecting the modal to appear:
https://github.com/HospitalRun/hospitalrun-frontend/blob/master/tests/acceptance/patient-notes-test.js#L24-L27
and
https://github.com/HospitalRun/hospitalrun-frontend/blob/master/tests/acceptance/patients-test.js#L90-L94

Those lines need to be changed to instead detect the inline message and then the tests should pass. Let me know if you need any help or further instruction on this.

@manaswinidas
Copy link
Contributor Author

@jkleinsc I have changed those test cases that you had mentioned, still I am getting some errors. Can you please help me debug those errors?

@jkleinsc
Copy link
Member

@dasManaswini I'll take a look today and see what the problem is.

Copy link
Member

@jkleinsc jkleinsc left a comment

Choose a reason for hiding this comment

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

@dasManaswini the main issue with the tests failing is that there is still code in the tests referencing the modal. I have commented below with more detail

andThen(function() {
assert.equal(find('.modal-title').text(), 'Patient Saved', 'Patient record has been saved');
assert.equal(find('.message').text(), 'Patient Saved', 'Patient record has been saved');
assert.equal(find('.modal-body').text().trim(), 'The patient record for John Doe has been saved.', 'Record has been saved');
Copy link
Member

Choose a reason for hiding this comment

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

This test is failing because .modal-body isn't displayed, .message is

andThen(function() {
assert.equal(find('.modal-title').text(), 'Patient Saved', 'Patient record has been saved');
assert.equal(find('.message').text(), 'Patient Saved', 'Patient record has been saved');
Copy link
Member

Choose a reason for hiding this comment

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

the text you are looking to find should be 'The patient record for John Doe has been saved.', not 'Patient Saved'

Copy link
Member

Choose a reason for hiding this comment

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

the modal close shouldn't be here

});
andThen(function() {
assert.equal(find('.modal-title').text(), 'Patient Saved', 'Patient record has been saved');
assert.equal(find('.message').text(), 'Patient Saved', 'Patient record has been saved');
Copy link
Member

Choose a reason for hiding this comment

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

the text you are looking to find should be 'The patient record for John Doe has been saved.', not 'Patient Saved'

@jkleinsc
Copy link
Member

@dasManaswini one more thing in looking at the tests. The following code in the tests:

waitToAppear('.message');

should be changed to:

waitToAppear('.message:contains(The patient record for John Doe has been saved)');

@manaswinidas
Copy link
Contributor Author

Thanks a lot for your guidance @jkleinsc I have made necessary changes as you had mentioned.

Copy link
Member

@jkleinsc jkleinsc left a comment

Choose a reason for hiding this comment

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

@dasManaswini thanks for making the updates. I'm glad to see the tests are now passing. The only thing I see now is that it looks like tests/acceptance/patients-test.js has been reformatted and I'd prefer not to merge it in that way as it makes comparing changes difficult. Does your text editor use tabs instead of spaces?

});
});
}
import Ember from 'ember';
Copy link
Member

Choose a reason for hiding this comment

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

Did you reformat this file? It appears as though the whole file has been changed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jkleinsc I had used eslint to fix the errors of the particular file.May be because of that the whole file appears to be reformatted.I am going to replace the existing file with the previous one so that you can easily merge it.

@recrsn recrsn force-pushed the enhancement/move_modal_to_inline branch from e0bdcfd to b1002f4 Compare March 28, 2017 17:45
@manaswinidas
Copy link
Contributor Author

@jkleinsc I have updated the branch with the necessary modifications. Please let me know if any further changes are to be made.

@jkleinsc
Copy link
Member

Thanks for sticking with this PR @dasManaswini! I think its ready to go, so I am going to merge it in.

@jkleinsc jkleinsc merged commit 1dad0d9 into HospitalRun:master Mar 29, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants