Skip to content
cccskills
FreePublished on GitHub

spark-component-snapshots-testing

Create or update the snapshots testing for a spark-ios-component-XXX.

The English summary is being prepared. Showing the original description.

See how to install

Files included (7)

  • SKILL.md2.4 KB
  • template/code/SparkUIXXX.swift29.5 KB
  • template/code/SparkXXX.swift13.7 KB
  • template/tests/Strategy/XXXConfigurationSnapshotTests.swift2.2 KB
  • template/tests/Strategy/XXXScenarioSnapshotTests.swift7.8 KB
  • template/tests/View/SparkUIXXXSnapshotTests.swift12.5 KB
  • template/tests/View/SparkXXXSnapshotTests.swift9.1 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

Add Repository Skill

Overview & Prerequisites

This skill guides you to implement/update the snapshots testing in spark component.

Component Selection

Parameter Handling:

  • If the skill is invoked with a parameter (e.g., /spark-component-snapshots-testing button):

    • Use the parameter as the component name
    • Verify the folder exists in Modules/Components/{component-name}/
    • If found, use that component and skip the selection step
  • If no parameter is provided:

    • List all folders in the Modules/Components/ directory
    • Use AskUserQuestion to let the user select ONE component from the list
    • Format: Display folder names as options (e.g., "button", "card", "checkbox")

Once the component is selected, all operations must be performed in Modules/Components/{component-name}/ folder.

Use the files in the template folder as reference to manage the snapshots testing for the View in the code folder.

Rules

The Snapshots file must respect theses rules :

  • must be located in Tests/SnapshotTests.
  • should contains a configuration which contains all variable to customize the component.
  • should contains a scenarios which contains all tests func to tests all configuration. Contains also a documentation func used to generate the snapshots for the Documentation.

Workflow

  • Read the content of the SparkXXX and SparkUIXXX
  • Create or update the configuration in the Tests/SnapshotTests/Common.
  • Create or update the list of scenarios in the Tests/SnapshotTests/Common.
  • Create or update the snapshots for UIKit and SwiftUI
  • Run swiftlint $ swiftlint.
  • Run sourcery $ sourcery
  • Implement the unit tests. Read theses folders to get mocks :
    • spark-ios-common/Sources/SnapshotTesting

Code Conventions

  • File headers follow pattern: Created by {firstname.lastname} on DD/MM/YYYY
  • Copyright line includes current year
  • No empty lines contain whitespace or tabs
  • All class members accessed with self.
  • Proper MARK comments in place

Test Implementation

  • Proper imports (SparkComponentXXX, SparkCommon, SparkTheming, @testable, @_spi(SI_SPI) @testable import SparkComponentXXXTesting, Testing, ...)

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Update the CHANGELOG.md with the description of the changes between the last released version and the new one

The English summary is being prepared. Showing the original description.

leboncoin/spark-ios22Updated Oct 8, 2026

Launch some action before create push in git

The English summary is being prepared. Showing the original description.

leboncoin/spark-ios22Updated Oct 8, 2026

Create or update a accessibility identifier file in the AccessibilityIdentifier folder in Sources of a spark-ios-component-XXX and add or update unit tests.

The English summary is being prepared. Showing the original description.

leboncoin/spark-ios22Updated Oct 8, 2026

Create or update a constants file in the Constants folder in Sources of a spark-ios-component-XXX and add or update unit tests.

The English summary is being prepared. Showing the original description.

leboncoin/spark-ios22Updated Oct 8, 2026

Create or update the DocC documentation in Sources of a spark-ios-component-XXX.

The English summary is being prepared. Showing the original description.

leboncoin/spark-ios22Updated Oct 8, 2026

Create or update an enum file in the Enum folder in Sources of a spark-ios-component-XXX and add or update unit tests.

The English summary is being prepared. Showing the original description.

leboncoin/spark-ios22Updated Oct 8, 2026

See all skills by leboncoin

Report a problem with this skill