Skip to content

[Auto] Add unit tests for craftd-core#98

Merged
rviannaoliveira merged 3 commits into
mainfrom
cover/test
Apr 12, 2026
Merged

[Auto] Add unit tests for craftd-core#98
rviannaoliveira merged 3 commits into
mainfrom
cover/test

Conversation

@rviannaoliveira
Copy link
Copy Markdown
Contributor

Auto-generated Unit Tests

Este PR foi gerado automaticamente pelo workflow Auto Generate Cover+Test usando a Claude API.

Evolução de cobertura

Arquivos Cobertura
Antes 0 / 17 0%
Depois 17 / 17 100%

Arquivos cobertos

StringExtensionsTest.kt,ContextExtesionTest.kt CraftDSimplePropertiesDiffCallbackTest.kt,CraftDComponentKeyTest.kt CraftDViewListenerTest.kt,AnalyticsPropertiesTest.kt ActionPropertiesTest.kt,TextPropertiesTest.kt SimplePropertiesTest.kt,SimplePropertiesResponseTest.kt ButtonPropertiesTest.kt,StylePropertiesTest.kt CheckBoxPropertiesTest.kt,ViewMapperVoTest.kt ViewMapperTest.kt,CraftDTextStyleTest.kt CraftDAlignTest.kt

Como funciona

  1. Um PR tocou arquivos em android_kmp/craftd-core
  2. Após o CI passar, o workflow escaneou todos os arquivos sem cobertura
  3. Claude gerou testes JUnit4 + MockK para cada arquivo
  4. Este PR foi criado automaticamente com o resultado

Checklist de revisão

  • Testes compilam sem erros (./gradlew testDebugUnitTest)
  • Testes cobrem os principais caminhos de lógica
  • Edge cases tratados (null, vazio, JSON inválido)

Triggered by PR #manual

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 29, 2026

🦙 MegaLinter status: ⚠️ WARNING

Descriptor Linter Files Fixed Errors Warnings Elapsed time
⚠️ KOTLIN detekt yes 189 no 4.99s
⚠️ MARKDOWN markdown-table-formatter 45 1 0 0.28s
⚠️ YAML prettier 18 1 4 0.88s

See detailed report in MegaLinter reports

You could have the same capabilities but better runtime performances if you use a MegaLinter flavor:

MegaLinter is graciously provided by OX Security

github-actions Bot and others added 2 commits April 11, 2026 20:37
- Add JUnit4, MockK and kotlin("test-junit") to androidUnitTest dependencies
- Fix CraftDViewListenerTest: remove markdown code fence wrappers (AI generator bug)
- Fix CraftDSimplePropertiesDiffCallbackTest: replace invalid throws() syntax with
  proper MockK every/throws pattern; remove dead AbstractMap objects with
  incompatible entries type overrides
- Fix ActionPropertiesTest: remove unused DiffUtil import
- Fix ButtonPropertiesTest: replace non-existent CraftDAlign.START/END with LEFT/RIGHT
- Fix TextPropertiesTest: replace non-existent CraftDTextStyle.REGULAR with NORMAL
- Fix StylePropertiesTest: add explicit type parameter to assertNotEquals for mixed types
- Fix CheckBoxPropertiesTest: remove annotation reflection tests for @Stable/@immutable
  and @serializable (binary retention, not visible at runtime)
- Fix SimplePropertiesTest: replace assertNotEquals with assertTrue(a !== b) for
  reference inequality checks
- Fix ContextExtesionTest: replace mockInputStream chain with ByteArrayInputStream
  (InputStream.bufferedReader() is an extension function, not mockable without mockkStatic)
- Fix ViewMapperVoTest: remove tests that assumed Jackson convertValue handles JSON
  strings and generic List conversion (unsupported by the implementation)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Documents recurring compile and runtime errors from CI-generated tests:
markdown code fences, invalid MockK usage, non-existent enum values,
annotation retention limits, extension function mocking, and Jackson
convertValue limitations. Serves as a reference to fix similar PRs faster.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@rviannaoliveira rviannaoliveira merged commit 5be5c3e into main Apr 12, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants