Command Palette

Search for a command to run...

Назад к скиллам
скилл № 45449

spark-component-snapshots-testing

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

БесплатноБез исполняемых скриптов
leboncoinот leboncoin★ 22 звезды на GitHub

Установить spark-component-snapshots-testing в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Об этом скилле

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

Snapshot Test Structure

  • The suite is annotated with @MainActor and @Suite(.sparkConfiguration)
  • One parameterized test per scenario: @Test("Spark XXX snapshot", arguments: XXXScenarioSnapshotTests.allCases) with func test(scenario:) async (no loop over all the scenarios)
  • UIKit tests exclude the documentation scenario: arguments: XXXScenarioSnapshotTests.allCases.filter { $0 != .documentation }
  • assertSnapshot is called with await
  • SwiftUI: the component modifiers (.sparkXXX...) are applied before .sparkTheme(self.theme), and the view ends with .background(.background) then .sparkIsSnapshot(true)
  • SwiftUI: pass forDocumentation: scenario.isDocumentation to assertSnapshot

Test Implementation

  • Proper imports (SparkComponentXXX, SparkCommon, SparkTheming, @testable, @_spi(SI_SPI) @testable import SparkComponentXXXTesting, Testing, ...)
  • Every @Test must have a description, written as the function name in a sentence (e.g. @Test("Radius should return radius full") for func radiusShouldReturnRadiusFull(), @Test("Value should return expected scale", arguments: [...]) for a parameterized test). Never use a bare @Test or @Test(arguments:)
Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

  • template/code/SparkUIXXX.swift
  • template/code/SparkXXX.swift

FAQ

Что делает скилл spark-component-snapshots-testing?

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

Как установить скилл spark-component-snapshots-testing?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл spark-component-snapshots-testing запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить spark-component-snapshots-testing с