conditionally hide load prior items button
fixes ADMIN-909 test plan: - if there are past items to load, you should be able to tab to the load prior items button - if all past items are loaded, the load prior items button should be missing. Change-Id: Ibbe46802a26ae09419fe7c26e7861a586698e7e6 Reviewed-on: https://gerrit.instructure.com/147189 Tested-by: Jenkins Reviewed-by: Mysti Sadler <mysti@instructure.com> QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com> Product-Review: Jon Willesen <jonw+gerrit@instructure.com>
This commit is contained in:
parent
c8d466fbae
commit
0fa4012da2
|
@ -94,3 +94,13 @@ it('shows new activity button when there is new activity, but no current items',
|
|||
/>);
|
||||
expect(wrapper.find('StickyButton')).toHaveLength(1);
|
||||
});
|
||||
|
||||
it('shows load prior items button when there is more to load', () => {
|
||||
const wrapper = shallow(<PlannerApp {...getDefaultValues()} />);
|
||||
expect(wrapper.find('ShowOnFocusButton')).toHaveLength(1);
|
||||
});
|
||||
|
||||
it('does not show load prior items button when all past items are loaded', () => {
|
||||
const wrapper = shallow(<PlannerApp {...getDefaultValues()} allPastItemsLoaded />);
|
||||
expect(wrapper.find('ShowOnFocusButton')).toHaveLength(0);
|
||||
});
|
||||
|
|
|
@ -148,6 +148,7 @@ export class PlannerApp extends Component {
|
|||
}
|
||||
|
||||
renderLoadPastButton () {
|
||||
if (this.props.allPastItemsLoaded) return;
|
||||
return (
|
||||
<ShowOnFocusButton
|
||||
buttonProps={{
|
||||
|
|
Loading…
Reference in New Issue