Skip to content

Commit

Permalink
Merge pull request #317 from samvera-labs/increase-default-timeout
Browse files Browse the repository at this point in the history
Increase Default Timeout
  • Loading branch information
cjcolvar authored Dec 21, 2023
2 parents 15fa94a + 1ef4456 commit 1b25afc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/services/iiif-parser.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,20 +254,20 @@ describe('iiif-parser', () => {
it('returns placeholderCanvas text and sets timer to default when duration is not defined', () => {
const itemMessage = iiifParser.getPlaceholderCanvas(playlistManifest, 0);
expect(itemMessage).toEqual('You do not have permission to playback this item.');
expect(util.CANVAS_MESSAGE_TIMEOUT).toEqual(3000);
expect(util.CANVAS_MESSAGE_TIMEOUT).toEqual(10000);
});

it('returns hard coded text when placeholderCanvas has no text and sets timer to default', () => {
const itemMessage = iiifParser.getPlaceholderCanvas(lunchroomManifest, 0);
expect(itemMessage).toEqual('This item cannot be played.');
expect(util.CANVAS_MESSAGE_TIMEOUT).toEqual(3000);
expect(util.CANVAS_MESSAGE_TIMEOUT).toEqual(10000);
});

it('returns default message when no placeholderCanvas is in the Canvas and sets timer to default', () => {
const itemMessage = iiifParser.getPlaceholderCanvas(singleSrcManifest, 0);
expect(console.error).toBeCalledTimes(1);
expect(itemMessage).toEqual('This item cannot be played.');
expect(util.CANVAS_MESSAGE_TIMEOUT).toEqual(3000);
expect(util.CANVAS_MESSAGE_TIMEOUT).toEqual(10000);
});
});

Expand Down
2 changes: 1 addition & 1 deletion src/services/utility-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const DEFAULT_ERROR_MESSAGE = "Error encountered. Please check your Manifest.";
export let GENERIC_ERROR_MESSAGE = DEFAULT_ERROR_MESSAGE;

// Timer for displaying placeholderCanvas text when a Canvas is empty
const DEFAULT_TIMEOUT = 3000;
const DEFAULT_TIMEOUT = 10000;
export let CANVAS_MESSAGE_TIMEOUT = DEFAULT_TIMEOUT;

/**
Expand Down
8 changes: 4 additions & 4 deletions src/services/utility-helpers.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -434,17 +434,17 @@ describe('util helper', () => {
describe('setCanvasMessageTimeout()', () => {
it('sets default value when param is undefined', () => {
util.setCanvasMessageTimeout(undefined);
expect(util.CANVAS_MESSAGE_TIMEOUT).toEqual(3000);
expect(util.CANVAS_MESSAGE_TIMEOUT).toEqual(10000);
});

it('sets default value when param is null', () => {
util.setCanvasMessageTimeout(null);
expect(util.CANVAS_MESSAGE_TIMEOUT).toEqual(3000);
expect(util.CANVAS_MESSAGE_TIMEOUT).toEqual(10000);
});

it('sets the given value', () => {
util.setCanvasMessageTimeout(10000);
expect(util.CANVAS_MESSAGE_TIMEOUT).toEqual(10000);
util.setCanvasMessageTimeout(3000);
expect(util.CANVAS_MESSAGE_TIMEOUT).toEqual(3000);
});
});

Expand Down

0 comments on commit 1b25afc

Please sign in to comment.