Skip to content

Commit

Permalink
Reformatted code to work with tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Adel-Atzouza committed Oct 19, 2024
1 parent 28ab22f commit b4f0408
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 17 deletions.
5 changes: 0 additions & 5 deletions packages/elements/src/components/app/theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@
--prism-selector: #00009f;
--prism-tag: var(--prism-selector);
--prism-keyword: var(--prism-selector);

--mut-mutant-polygon-color: black;

}
:host([theme='dark']) {
// From https://atelierbram.github.io/syntax-highlighting/prism/demo/assets/css/prism-atom-dark.css
Expand Down Expand Up @@ -95,8 +92,6 @@
--prism-regex: #e9c062;

--prism-important: #fd971f;

--mut-mutant-polygon-color: var(--mut-gray-800);
}

// File icon theming ================================
Expand Down
20 changes: 9 additions & 11 deletions packages/elements/src/components/file/file.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,19 +134,17 @@ export class FileComponent extends RealTimeElement {

private renderMutantDots(mutants: MutantModel[] | undefined) {
return mutants?.length
? mutants.map(
(mutant) =>
svg`
<svg mutant-id="${mutant.id}" class="mutant-dot ${mutant.status}" height="10" width="12">
? mutants.map((mutant) => {
const selected = this.selectedMutant?.id === mutant.id;
const selectedClass = selected ? 'selected' : '';

return svg`
<svg mutant-id="${mutant.id}" class="mutant-dot ${selectedClass} ${mutant.status}" height="10" width="12">
<title>${title(mutant)}</title>
${this.selectedMutant?.id === mutant.id
?
svg`<polygon class="mutant-dot-polygon selected " points="5,10 0,0 10,0" />`
:
svg`<circle cx="5" cy="5" r="5" color="red" />`}
</svg>`,
)
${selected ? svg`<polygon class="mutant-dot-polygon" points="5,10 0,0 10,0" />` : svg`<circle cx="5" cy="5" r="5" color="red" />`}
</svg>`;
})
: nothing;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/elements/src/components/file/file.scss
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ $mutant-squiggly: 'Survived', 'NoCoverage';
}
}

polygon.mutant-dot-polygon.selected {
polygon.mutant-dot-polygon {
@apply stroke-gray-800;
}

Expand Down

0 comments on commit b4f0408

Please sign in to comment.