All Projects → David-Desmaisons → Componentfixture

David-Desmaisons / Componentfixture

Licence: mit
🛠️Interactive sandox playground for vue components

Projects that are alternatives of or similar to Componentfixture

hypothesis-gufunc
Extension to hypothesis for testing numpy general universal functions
Stars: ✭ 32 (-27.27%)
Mutual labels:  sandbox, testing-tools
Reactopt
A CLI React performance optimization tool that identifies potential unnecessary re-rendering
Stars: ✭ 1,975 (+4388.64%)
Mutual labels:  testing-tools, component
Carc.in
Compile & run code in
Stars: ✭ 62 (+40.91%)
Mutual labels:  playground, sandbox
Cattle
🐺 Platform to Run and Share Code. It Supports PHP, Python, Ruby, Java, Go, Rust, C and C++.
Stars: ✭ 40 (-9.09%)
Mutual labels:  playground, sandbox
Dbdeployer
DBdeployer is a tool that deploys MySQL database servers easily.
Stars: ✭ 467 (+961.36%)
Mutual labels:  sandbox, testing-tools
Deer Executor
An executor for online judge —— 基于Go语言实现的代码评测工具
Stars: ✭ 23 (-47.73%)
Mutual labels:  playground, sandbox
Graphql Editor
📺 Visual Editor & GraphQL IDE. Draw GraphQL schemas using visual 🔷 nodes and explore GraphQL API with beautiful UI. Even 🐒 can do that!
Stars: ✭ 5,485 (+12365.91%)
Mutual labels:  playground, sandbox
Vuep
🎡 A component for rendering Vue components with live editor and preview.
Stars: ✭ 840 (+1809.09%)
Mutual labels:  playground, component
Vst2
Bindings for vst2 sdk
Stars: ✭ 39 (-11.36%)
Mutual labels:  component
Vue Drag Resize
Vue Component for resize and drag elements
Stars: ✭ 1,007 (+2188.64%)
Mutual labels:  component
React Currency Formatter
💵 react component for currency formatting
Stars: ✭ 38 (-13.64%)
Mutual labels:  component
Vue Clock Picker
A vue-based time picker Component
Stars: ✭ 39 (-11.36%)
Mutual labels:  component
React Sider
Lightweight Ant Design Pro like <Sider /> component integrated with Ant Design Menu.
Stars: ✭ 42 (-4.55%)
Mutual labels:  component
Junit Extensions
JUnit5 extensions library including JUnit5 equivalents of some of the common JUnit4 rules: ExpectedException, TemporaryFolder etc
Stars: ✭ 39 (-11.36%)
Mutual labels:  testing-tools
Imagecoordinatespace
UICoordinateSpace for UIImageView image
Stars: ✭ 42 (-4.55%)
Mutual labels:  playground
Webmockr
R library for stubbing and setting expectations on HTTP requests
Stars: ✭ 37 (-15.91%)
Mutual labels:  testing-tools
Dom99
Extend html with directives
Stars: ✭ 37 (-15.91%)
Mutual labels:  component
Beziercurve
Bezier curve master
Stars: ✭ 43 (-2.27%)
Mutual labels:  component
Snapshottest
Snapshot testing tool for iOS and tvOS
Stars: ✭ 42 (-4.55%)
Mutual labels:  testing-tools
Ecs Snake
Simple snake game powered by ecs framework.
Stars: ✭ 41 (-6.82%)
Mutual labels:  component

Component Fixture

CircleCI Coverage codebeat badge GitHub open issues Npm version MIT License

Demo

https://david-desmaisons.github.io/ComponentFixture/

Description

Interactive test fixture for vue component.

Component is designed to receive any component you want to test as a default slot

<sandbox>

  <!-- Use the default slot to create the component under test -->
  <component-under-test/>

</sandbox>

Component-fixture will automatically:

  • Mirror all the props of the tested component
  • Bind this data to the component under-test
  • Display all the props in a form so that it is possible to edit them

Features:

  • Respect props type and use custom input for each type
  • Provide input for objects and function
  • Create v-model binding if needed
  • Support of two-way data binding using the .sync modifier pattern
  • Custom props validation when available
  • Support component with slots
  • Display of all events emitted by the component
  • Display of component data and computed information
  • Exposition of component method as buttons that can be called with display of the produced result
  • Compatible with hot-reload: automatic update on changes happening on the tested component

Example using vue-slider-component:

demo

Uses cases

Why would you need such a component?

ComponentFixture is intended to be used only in a test/dev context with two main applications.

Discovering third party component

  • Explore Interactively a component you are willing to use in your application.
  • Understand by example what the props role.
  • Quickly identify bugs and limitation on the component.

Testing a component you creates

  • Create an example usage of your component that will update automatically
  • Interact with the component while you create it.
  • Easily identify bugs

Next steps

  • [x] Provide a way to default component props
  • [ ] Monkey testing: use randomly generated updates on component props.

This will be provided on next major version.

Example usage

<sandbox :defaults="{value: 23}">

  <!-- Use the default slot to for the component under test -->
  <component-under-test></component-under-test>

</sandbox>
import { Sandbox } from 'component-fixture'
import "component-fixture/dist/ComponentFixture.css"
import { componentUnderTest } from 'componentUnderTest'

export default {
  components: {
    componentUnderTest,
    Sandbox
  }
}

API

slots

  • default Slot for the component under test

props

  • defaults Object (optional)

    Value: {[propName]: defaultValue}

    Object sets to default the component under-test props. For example if you want to default the props value with 46, use: :defaults="{value: 46}"

  • possibleValues Object (optional)

    Value: {[propName]: [...values]}

    Object used to predefined the possible values for a given props. The values defined by possibleValues will be used to create a select from the provided values for the given props. For example if you want to limit the props value to 1,2, 3 or 4, use: :possibleValues="{value: [1,2,3,4]}"

  • componentHeight String (optional)

    Style to be applied to the component under-test height. Default to null.

  • componentWidth String (optional)

    Style to be applied to the component under-test width. Default to null.

  • useStore Boolean (default: false)

    If true and vuex is being used, a store module is automatically created and its state is bound to component props.

Installation

npm install ComponentFixture

Project setup

npm install

Compiles and hot-reloads for development

npm run serve

Compiles and minifies for production

npm run build

Lints and fixes files

npm run lint

Run your unit tests

npm run test:unit

Update the API section of README.md with generated documentation

npm run doc:build

Run style guide dev server

npm run styleguide

Generate a static HTML style guide

npm run styleguide:build
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].