question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Any way to integrate a living styleguide for only testing / presenting css classes?

See original GitHub issue

I’m trying to documentate what kind of buttons my ui framework has This is what I tried (altough I guessed this won’t do)

import { Component } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';

describe('ButtonTestHost', () => {
    let component: ButtonTestHost;
    let fixture: ComponentFixture<ButtonTestHost>;

    beforeEach(async(() => {
        /**
         * @uijar ButtonTestHost
         * @hostcomponent ButtonTestHost
         */
        let moduleDefinition = {
            declarations: [ButtonTestHost]
        };

        TestBed.configureTestingModule(moduleDefinition).compileComponents();
    }));


    beforeEach(() => {
        fixture = TestBed.createComponent(ButtonTestHost);
        component = fixture.componentInstance;
        fixture.detectChanges();
    });

    /** @uijarexample */
    it('should be displayed', () => {
        // ...
    });
});

/**
 * @group CSS
 * @component Buttons
 * @description
 */
@Component({
    selector: 'button-test-host',
    template: `<button class="button-primary">Button label</button> <button class="button-primary-alt">Button label</button><br>
<button class="button-secondary">Button label</button> <button class="button-secondary-alt">Button label</button><br>
<button class="button-green">Button label</button> <button class="button-green-alt">Button label</button><br>
<button class="button-yellow">Button label</button> <button class="button-yellow-alt">Button label</button><br>
<button class="button-red">Button label</button> <button class="button-red-alt">Button label</button><br>`
})
export class ButtonTestHost {
}

I tried to documentate the buttons with a buttons.spec.ts inside my styles directory.

What I am getting is:

Generating resources...
Could not find any reference to "ButtonTestHost".
Verify that "@uijar ButtonTestHost" or "@hostcomponent ButtonTestHost" is using correct component reference name.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
nordingcommented, Nov 11, 2017

I created a new issue #7 regarding the templateUrl.

0reactions
kroedercommented, Nov 12, 2017

Thanks, I’m closing this since it’s solved.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Creating A Living Style Guide: A Case Study
Living style guides are an important tool for web development today, especially in large, complex web applications.
Read more >
How to Develop a Living Style Guide | Fabian Keller
Living style guides are a very powerful tool to write clean SCSS code. They simplify the design and implementation of reusable components.
Read more >
CSS Testing: The Definitive Guide - Testim.io
Demystifying the ever-changing world of CSS testing with a high-level view of the types, challenges, and benefits of CSS testing.
Read more >
How To Create a Complete Web Design Style Guide + Template
These will define how your pages are structured. To get started, you can create some basic templates for your main layouts.
Read more >
Creating Style Guides - A List Apart
To me, a style guide is a living document of code, which details all the various elements and coded modules of your site...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found