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
OCLOMRS-472: Implement the Retire/Un-Retire button #367
Conversation
This PR is currently a Work In Progress |
d90326d
to
1406abd
Compare
Pull Request Test Coverage Report for Build 2571
💛 - Coveralls |
a41b222
to
a07295b
Compare
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.
LGTM
package.json
Outdated
@@ -30,7 +30,7 @@ | |||
"uuid": "^3.3.2" | |||
}, | |||
"scripts": { | |||
"start": "chmod +x ./init.sh && ./init.sh && cp env-config.js ./public/ && npm run build:css && react-scripts start", |
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.
How is this related to the ticket?
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 have created a separate ticket for it. I'll remove the change from this one
a07295b
to
b8f6285
Compare
b6cc573
to
308021e
Compare
}); | ||
}); | ||
const store = mockStore({ payload: {} }); | ||
return store.dispatch(retireConcept(sampleConcept.url, { retired: false })).then(() => { |
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.
How is this testing for should unretire a concept?
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 have updated the retireConcept()
action to return the retired concept and I am now testing directly for the retired flag. expect(result.retired).toEqual(true);
when retiring, and expect(result.retired).toEqual(false);
when un-retiring.
11f195e
to
a2702cb
Compare
@@ -381,6 +382,49 @@ describe('Test suite for dictionary actions', () => { | |||
expect(store.getActions()).toEqual(expectedActions); | |||
}); | |||
}); | |||
|
|||
it('should retire a concept', () => { |
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.
When should retire a concept happen?
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.
This action is triggered when the retire
button is clicked
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 you keep around to keep answering the maintainers of this code whenever they ask 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.
I have updated the message accordingly
}); | ||
}); | ||
|
||
it('should unretire a concept', () => { |
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.
When should unretire a concept happen?
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.
This action is triggered when the unretire
button is clicked
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 have updated the message accordingly.
a2702cb
to
e9f4b38
Compare
response: sampleRetiredConcept, | ||
}); | ||
}); | ||
const store = mockStore({ payload: {} }); |
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.
Where are is the simulation of clicking the retire button?
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.
DictionaryConcepts.test.jsx
lines 528 - 621
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 mean in this very test?
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.
This is the Action that is triggered when the button is clicked. The test is only for the Action and the button click test is in the lines I mentioned. Therefore the simulation for the button click is not (and should not be) in this test.
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.
Then i find this confusing "should retire a concept when the retire button is clicked"
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 understand the concern. Should I change it to "should retire a concept when the retireConcept method is triggered"
?
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 have changed the title to should retire a concept when the retireConcept action is triggered with the true argument
response: sampleConcept, | ||
}); | ||
}); | ||
const store = mockStore({ payload: {} }); |
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 above
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.
DictionaryConcepts.test.jsx
lines 528 - 621
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 above
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 have changed the title to should unretire a concept when the retireConcept action is triggered with the false argument
@@ -18,6 +18,7 @@ import { | |||
import { filterPayload } from '../../reducers/util'; | |||
import { addDictionaryReference } from '../bulkConcepts'; | |||
import api from '../../api'; | |||
import instance from '../../../config/axiosConfig'; |
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.
What is the meaning of instance?
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 have used a more appropriate name (axiosInstance
)
e9f4b38
to
35e3ac2
Compare
35e3ac2
to
d7211b8
Compare
JIRA TICKET NAME:
Implement the Retire/Un-Retire button
Summary:
Ensure that one can Retire custom Concepts as well as Unretire them