MCPcopy Create free account
hub / github.com/decaporg/decap-cms / populateEntry

Function populateEntry

cypress/utils/steps.js:269–285  ·  view source on GitHub ↗
(entry, onDone = flushClockAndSave)

Source from the content-addressed store, hash-verified

267}
268
269function populateEntry(entry, onDone = flushClockAndSave) {
270 const keys = Object.keys(entry);
271 for (const key of keys) {
272 const value = entry[key];
273 if (key === 'body') {
274 cy.getMarkdownEditor().first().as('bodyEditor');
275 cy.get('@bodyEditor').click();
276 cy.get('@bodyEditor').clear({ force: true });
277 cy.get('@bodyEditor').type(value, { force: true });
278 } else {
279 cy.get(`[id^="${key}-field"]`).first().clear({ force: true });
280 cy.get(`[id^="${key}-field"]`).first().type(value, { force: true });
281 }
282 }
283
284 onDone();
285}
286
287function newPost() {
288 // click even if covered by toast

Calls 2

getMethod · 0.80
clearMethod · 0.80

Tested by

no test coverage detected