Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
hugo-vrijswijk committed Nov 12, 2024
1 parent 53ae0b2 commit aa6e6ad
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
3 changes: 2 additions & 1 deletion packages/elements/src/components/file/file.component.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { PropertyValues } from 'lit';
import { html, nothing, svg, unsafeCSS } from 'lit';
import { customElement, property, state } from 'lit/decorators.js';
import { classMap } from 'lit/directives/class-map.js';
import { map } from 'lit/directives/map.js';
import { createRef, ref } from 'lit/directives/ref.js';
import type { FileUnderTestModel, MutantModel } from 'mutation-testing-metrics';
Expand Down Expand Up @@ -139,7 +140,7 @@ export class FileComponent extends RealTimeElement {
(mutant) =>
svg`<svg
mutant-id="${mutant.id}"
class="mutant-dot ${this.selectedMutant?.id === mutant.id ? 'selected' : mutant.status}"
class="${classMap({ selected: this.selectedMutant?.id === mutant.id })} ${mutant.status} mutant-dot "
height="10"
width="12"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import type { TestFileModel, TestModel } from 'mutation-testing-metrics';
import { TestStatus } from 'mutation-testing-metrics';
import style from './test-file.scss?inline';

import { classMap } from 'lit/directives/class-map.js';
import { map } from 'lit/directives/map.js';
import { repeat } from 'lit/directives/repeat.js';
import { determineLanguage, gte, highlightCode, transformHighlightedLines } from '../../lib/code-helpers.js';
Expand Down Expand Up @@ -161,7 +162,7 @@ export class TestFileComponent extends RealTimeElement {
(test) =>
svg`<svg
test-id="${test.id}"
class="test-dot ${this.selectedTest === test ? 'selected' : test.status}"
class="${classMap({ selected: this.selectedTest?.id === test.id })} test-dot ${test.status}"
@click=${(ev: MouseEvent) => {
ev.stopPropagation();
this.toggleTest(test);
Expand All @@ -170,11 +171,13 @@ export class TestFileComponent extends RealTimeElement {
width="12"
>
<title>${title(test)}</title>
${this.selectedTest === test
? // Triangle pointing down
svg`<path class="stroke-gray-800" d="M5,10 L0,0 L10,0 Z" />`
: // Circle
svg`<circle cx="5" cy="5" r="5" />`}
${
this.selectedTest === test
? // Triangle pointing down
svg`<path class="stroke-gray-800" d="M5,10 L0,0 L10,0 Z" />`
: // Circle
svg`<circle cx="5" cy="5" r="5" />`
}
</svg>`,
)
: nothing;
Expand Down

0 comments on commit aa6e6ad

Please sign in to comment.