{"id":20850021,"url":"https://github.com/david-desmaisons/componentfixture","last_synced_at":"2025-05-12T04:31:05.553Z","repository":{"id":39042828,"uuid":"146237674","full_name":"David-Desmaisons/ComponentFixture","owner":"David-Desmaisons","description":"🛠️Interactive sandox playground for vue components","archived":false,"fork":false,"pushed_at":"2022-12-10T02:21:30.000Z","size":18807,"stargazers_count":51,"open_issues_count":34,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-01T00:19:53.629Z","etag":null,"topics":["component","fixture-test","playground","sandbox","testing-tools","vuejs"],"latest_commit_sha":null,"homepage":"https://david-desmaisons.github.io/ComponentFixture/","language":"Vue","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/David-Desmaisons.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-08-27T02:37:19.000Z","updated_at":"2024-05-28T18:45:13.000Z","dependencies_parsed_at":"2023-01-25T19:45:44.762Z","dependency_job_id":null,"html_url":"https://github.com/David-Desmaisons/ComponentFixture","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/David-Desmaisons%2FComponentFixture","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/David-Desmaisons%2FComponentFixture/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/David-Desmaisons%2FComponentFixture/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/David-Desmaisons%2FComponentFixture/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/David-Desmaisons","download_url":"https://codeload.github.com/David-Desmaisons/ComponentFixture/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253675170,"owners_count":21945909,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["component","fixture-test","playground","sandbox","testing-tools","vuejs"],"created_at":"2024-11-18T03:07:44.269Z","updated_at":"2025-05-12T04:31:03.310Z","avatar_url":"https://github.com/David-Desmaisons.png","language":"Vue","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\u003cp align=\"center\"\u003e\u003cimg width=\"150\"src=\"./logo.png\"\u003e\u003c/p\u003e\n\n# Component Fixture\n\n[![CircleCI](https://circleci.com/gh/David-Desmaisons/ComponentFixture.svg?style=shield)](https://circleci.com/gh/David-Desmaisons/ComponentFixture)\n[![Coverage](https://codecov.io/gh/David-Desmaisons/ComponentFixture/branch/master/graph/badge.svg)](https://codecov.io/gh/David-Desmaisons/ComponentFixture)\n[![codebeat badge](https://codebeat.co/badges/ef3ab715-530e-4047-80f3-17030e82b1c8)](https://codebeat.co/projects/github-com-david-desmaisons-componentfixture-master)\n[![GitHub open issues](https://img.shields.io/github/issues/David-Desmaisons/ComponentFixture.svg?maxAge=20)](https://github.com/David-Desmaisons/ComponentFixture/issues)\n[![Npm version](https://img.shields.io/npm/v/component-fixture.svg?maxAge=20)](https://www.npmjs.com/package/component-fixture)\n[![MIT License](https://img.shields.io/github/license/David-Desmaisons/ComponentFixture.svg)](https://github.com/David-Desmaisons/ComponentFixture/blob/master/LICENSE)\n\n## Demo\n\nhttps://david-desmaisons.github.io/ComponentFixture/\n\n## Description\n\nInteractive test fixture for vue component.\n\nComponent is designed to receive any component you want to test as a default slot\n\n```HTML\n\u003csandbox\u003e\n\n  \u003c!-- Use the default slot to create the component under test --\u003e\n  \u003ccomponent-under-test/\u003e\n\n\u003c/sandbox\u003e\n```\n### Component-fixture will automatically:\n  - Mirror all the props of the tested component\n  - Bind this data to the component under-test\n  - Display all the props in a form so that it is possible to edit them\n\n### Features:\n  - Respect props type and use custom input for each type\n  - Provide input for objects and function\n  - Create `v-model` binding if needed\n  - Support of two-way data binding using the [`.sync` modifier pattern](https://vuejs.org/v2/guide/components-custom-events.html#sync-Modifier)\n  - Custom props validation when available\n  - Support component with slots\n  - Display of all events emitted by the component\n  - Display of component `data` and `computed` information\n  - Exposition of component method as buttons that can be called with display of the produced result\n  - Compatible with hot-reload: automatic update on changes happening on the tested component\n\nExample using [vue-slider-component](https://github.com/NightCatSama/vue-slider-component):\n\n![demo](./doc-images/example.png)\n\n\n## Uses cases\n\nWhy would you need such a component?\n\n`ComponentFixture` is intended to be used only in a test/dev context with two main applications.\n\n### Discovering third party component\n  - Explore Interactively a component you are willing to use in your application.\n  - Understand by example what the props role.\n  - Quickly identify bugs and limitation on the component. \n\n\n### Testing a component you creates \n  - Create an example usage of your component that will update automatically\n  - Interact with the component while you create it.\n  - Easily identify bugs\n\n## Next steps\n\n  - [x] Provide a way to default component props\n  - [ ] Monkey testing: use randomly generated updates on component props.\n\nThis will be provided on next major version.\n\n## Example usage\n\n```HTML\n\u003csandbox :defaults=\"{value: 23}\"\u003e\n\n  \u003c!-- Use the default slot to for the component under test --\u003e\n  \u003ccomponent-under-test\u003e\u003c/component-under-test\u003e\n\n\u003c/sandbox\u003e\n```\n\n```javascript\nimport { Sandbox } from 'component-fixture'\nimport \"component-fixture/dist/ComponentFixture.css\"\nimport { componentUnderTest } from 'componentUnderTest'\n\nexport default {\n  components: {\n    componentUnderTest,\n    Sandbox\n  }\n}\n```\n\n### API\n#### slots \n\n- `default` Slot for the component under test\n\n#### props \n\n- `defaults` ***Object*** (*optional*) \n\n  Value: `{[propName]: defaultValue}`\n\n   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}\"`\n\n- `possibleValues` ***Object*** (*optional*) \n\n  Value: `{[propName]: [...values]}`\n\n   Object used to predefined the possible values for a given props.\n   The values defined by `possibleValues` will be used to create a select from the provided values for the given props.\n   For example if you want to limit the props value to 1,2, 3 or 4, use:  `:possibleValues=\"{value: [1,2,3,4]}\"`\n\n- `componentHeight` ***String*** (*optional*) \n\n    Style to be applied to the component under-test height. Default to null.\n\n- `componentWidth` ***String*** (*optional*) \n\n    Style to be applied to the component under-test width. Default to null.\n\n- `useStore` ***Boolean*** (*default: false*) \n\n    If true and vuex is being used, a store module is automatically created and its state is bound to component props.\n\n\n## Installation\n\n```\nnpm install ComponentFixture\n```\n\n## Project setup\n\n```\nnpm install\n```\n\n### Compiles and hot-reloads for development\n\n```\nnpm run serve\n```\n\n### Compiles and minifies for production\n\n```\nnpm run build\n```\n\n### Lints and fixes files\n\n```\nnpm run lint\n```\n\n### Run your unit tests\n\n```\nnpm run test:unit\n```\n\n### Update the API section of README.md with generated documentation\n\n```\nnpm run doc:build\n```\n\n### Run style guide dev server\n\n```\nnpm run styleguide\n```\n\n### Generate a static HTML style guide\n\n```\nnpm run styleguide:build\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavid-desmaisons%2Fcomponentfixture","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavid-desmaisons%2Fcomponentfixture","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavid-desmaisons%2Fcomponentfixture/lists"}