Skip to content

Commit

Permalink
v1.3.0 (#80)
Browse files Browse the repository at this point in the history
* Changed borrow button label from lending bar
  • Loading branch information
nsharma123 authored Sep 13, 2024
1 parent 7170a59 commit 09f7f48
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@internetarchive/ia-book-actions",
"version": "1.2.0",
"version": "1.3.0",
"description": "Bookreader actions for borrowable book",
"author": "Internet Archive",
"license": "AGPL-3.0-only",
Expand Down
1 change: 1 addition & 0 deletions src/components/collapsible-action-group.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ export class CollapsibleActionGroup extends ActionsHandler {

get getPrimaryItems() {
return this.primaryActions
.slice(1)
.map(
action =>
html`<li>${this.renderActionButton(action, this.initialButton)}</li>`
Expand Down
2 changes: 1 addition & 1 deletion src/core/services/actions-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default class ActionsConfig {
firstBrowseConfig() {
return {
id: 'browseBook',
text: 'Borrow (auto-renewing)',
text: 'Borrow',
className: 'primary',
analyticsEvent: {
category: this.analyticsCategories.preview,
Expand Down
8 changes: 4 additions & 4 deletions test/core/services/get-lending-actions.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe('Get Lending Actions', () => {

expect(actions.primaryTitle).to.equal(bookTitles.available_1hr);
expect(actions.primaryActions.length).to.equal(3);
expect(actions.primaryActions[0].text).to.equal('Borrow (auto-renewing)');
expect(actions.primaryActions[0].text).to.equal('Borrow');
expect(actions.primaryActions[1].text).to.equal('Borrow for 14 days');
expect(actions.secondaryActions[1].text).to.equal('Purchase at ');
});
Expand Down Expand Up @@ -111,7 +111,7 @@ describe('Get Lending Actions', () => {
expect(actions.primaryTitle).to.equal(bookTitles.claim_waitlist);
expect(actions.primaryActions.length).to.equal(3);
expect(actions.primaryActions[0].text).to.equal('Borrow for 14 days');
expect(actions.primaryActions[1].text).to.equal('Borrow (auto-renewing)');
expect(actions.primaryActions[1].text).to.equal('Borrow');
expect(actions.primaryActions[2].text).to.equal('Leave Waitlist');
expect(spy.called).to.be.true;
});
Expand All @@ -138,7 +138,7 @@ describe('Get Lending Actions', () => {
expect(actions.primaryTitle).to.equal(bookTitles.on_waitlist);
expect(actions.primaryActions.length).to.equal(2);
expect(actions.primaryActions[0].text).to.equal('Leave Waitlist');
expect(actions.primaryActions[1].text).to.equal('Borrow (auto-renewing)');
expect(actions.primaryActions[1].text).to.equal('Borrow');
expect(claimSpy.called).to.be.false;
expect(waitlistSpy.called).to.be.true;
});
Expand All @@ -162,7 +162,7 @@ describe('Get Lending Actions', () => {
expect(actions.primaryTitle).to.equal(bookTitles.on_waitlist);
expect(actions.primaryActions.length).to.equal(2);
expect(actions.primaryActions[0].text).to.equal('Leave Waitlist');
expect(actions.primaryActions[1].text).to.equal('Borrow (auto-renewing)');
expect(actions.primaryActions[1].text).to.equal('Borrow');
expect(waitlistSpy.called).to.be.true;
});
});
Expand Down
2 changes: 1 addition & 1 deletion test/ia-book-actions.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ describe('Borrow status actions', () => {

// removed available_to_borrow from lending bar
expect(el.lendingStatus.available_to_borrow).to.be.false;
expect(el.primaryActions[0].text).to.equal('Borrow (auto-renewing)');
expect(el.primaryActions[0].text).to.equal('Borrow');
});

it('Check action for borrowable book without user', async () => {
Expand Down

0 comments on commit 09f7f48

Please sign in to comment.