Skip to content

Commit

Permalink
Merge "CRUD: Cache the result of getLocalSiteId() in entityHelper.js"
Browse files Browse the repository at this point in the history
  • Loading branch information
jenkins-bot authored and Gerrit Code Review committed Feb 25, 2025
2 parents 558107f + 76209ab commit 700cfe2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion repo/domains/crud/tests/mocha/helpers/entityHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const {

let stringPropertyId;
let testItemId;
let localSiteId;

/**
* Creates a reusable property on the first call and returns it on subsequent calls.
Expand Down Expand Up @@ -140,10 +141,12 @@ function newStatementWithRandomStringValue( propertyId ) {
}

async function getLocalSiteId() {
return ( await action.getAnon().meta(
localSiteId = localSiteId || ( await action.getAnon().meta(
'wikibase',
{ wbprop: 'siteid' }
) ).siteid;

return localSiteId;
}

async function createLocalSitelink( itemId, title, badges = [] ) {
Expand Down

0 comments on commit 700cfe2

Please sign in to comment.