Skip to content

Commit

Permalink
CORE: disable the requirement for having a url, when enabling renderN…
Browse files Browse the repository at this point in the history
…ow in Renderer (prebid#9769)

* disable the requirement for having a url, when enabling renderNow in the Renderer

* kick off circleci

---------

Co-authored-by: Chris Huie <phoenixtechnerd@gmail.com>
  • Loading branch information
2 people authored and jorgeluisrocha committed May 18, 2023
1 parent 597fa71 commit f0abeec
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/Renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export function Renderer(options) {
this.config = config;
this.handlers = {};
this.id = id;
this.renderNow = renderNow;

// a renderer may push to the command queue to delay rendering until the
// render function is loaded by loadExternalScript, at which point the the command
Expand Down Expand Up @@ -110,7 +111,7 @@ Renderer.prototype.process = function() {
* @returns {Boolean}
*/
export function isRendererRequired(renderer) {
return !!(renderer && renderer.url);
return !!(renderer && (renderer.url || renderer.renderNow));
}

/**
Expand Down
3 changes: 1 addition & 2 deletions test/spec/renderer_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ describe('Renderer', function () {
expect(testRenderer2.getConfig()).to.deep.equal({ test: 'config2' });
});

it('sets a render function with setRender method', function () {
it('sets a render function with the setRender method', function () {
testRenderer1.setRender(spyRenderFn);
expect(typeof testRenderer1.render).to.equal('function');
testRenderer1.render();
Expand Down Expand Up @@ -110,7 +110,6 @@ describe('Renderer', function () {

it('renders immediately when requested', function () {
const testRenderer3 = Renderer.install({
url: 'https://httpbin.org/post',
config: { test: 'config2' },
id: 2,
renderNow: true
Expand Down

0 comments on commit f0abeec

Please sign in to comment.