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

Function populateEntry

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

Source from the content-addressed store, hash-verified

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

Calls 2

getMethod · 0.80
clearMethod · 0.80

Tested by

no test coverage detected