{ "build_script": "build", "build_workdir": ".", "bundle_artifact": "", "decision_relevant_fields": [ "adapter_state.newPropClassApplied", "adapter_state.legacyWarningEmitted", "adapter_state.legacyPropClassApplied" ], "execution_mode": "node", "expected_page_errors": [], "instance_id": "hacker0x01__react-datepicker-4643", "payload": {}, "predicate_description": "The new calendarIconClassName prop is applied to the calendar icon SVG and the legacy calendarIconClassname prop emits a deprecation warning.", "predicate_js": "(s) => s.adapter_state.newPropClassApplied === true && s.adapter_state.legacyWarningEmitted === true", "product_output_kind": "rendered_document", "program_js": "const fs = require('fs');\n\nconst input = JSON.parse(Buffer.from(process.argv[1], 'base64').toString('utf8'));\nconst outputPath = process.argv[2];\n\nconst esc = (v) => String(v).replace(/&/g, '&').replace(//g, '>');\n\nlet state;\nlet page;\n\ntry {\n const React = require('react');\n const ReactDOMServer = require('react-dom/server');\n const DatePicker = require('/testbed/dist/index.js').default;\n\n const warnings = [];\n const originalWarn = console.warn;\n console.warn = (...args) => {\n warnings.push(args.join(' '));\n };\n\n const newPropClass = 'new-prop-class';\n const legacyPropClass = 'legacy-prop-class';\n\n const newPropHtml = ReactDOMServer.renderToStaticMarkup(\n React.createElement(DatePicker, {\n selected: new Date('2023-12-17T00:00:00Z'),\n showIcon: true,\n calendarIconClassName: newPropClass,\n toggleCalendarOnIconClick: true,\n })\n );\n\n const legacyPropHtml = ReactDOMServer.renderToStaticMarkup(\n React.createElement(DatePicker, {\n selected: new Date('2023-12-17T00:00:00Z'),\n showIcon: true,\n calendarIconClassname: legacyPropClass,\n toggleCalendarOnIconClick: true,\n })\n );\n\n console.warn = originalWarn;\n\n const newHasClass = newPropHtml.includes(newPropClass);\n const legacyHasClass = legacyPropHtml.includes(legacyPropClass);\n const legacyWarning = warnings.some(\n (w) => w.includes('calendarIconClassname') && w.includes('deprecated')\n );\n\n state = {\n render_ok: true,\n newPropClassApplied: newHasClass,\n legacyPropClassApplied: legacyHasClass,\n legacyWarningEmitted: legacyWarning,\n warnings: warnings,\n };\n\n page = `\n\n\n\n${esc(input.title)}\n\n\n\n
\n

calendarIconClassName (new prop)

\n ${newPropHtml}\n
\n
\n

calendarIconClassname (legacy prop)

\n ${legacyPropHtml}\n
\n\n\n`;\n} catch (e) {\n state = {\n render_ok: false,\n error: { name: String(e && e.name || 'Error'), message: String(e && e.message || e) },\n };\n page = `\n\n${esc(input.title)}\n\n
${esc(state.error.name + ': ' + state.error.message)}
\n\n\n`;\n}\n\nfs.writeFileSync(outputPath, page, 'utf8');", "rationale": "Rendering with calendarIconClassName and the legacy calendarIconClassname shows the new prop is ignored before the fix and applied after, while the legacy prop emits a deprecation warning only after the fix.", "repo": "Hacker0x01/react-datepicker", "schema_version": "worldmodelmmbench.render-probe.v3", "title": "Calendar icon class name prop naming", "viewport": [ 1280, 960 ], "volatile_fields": [] }