mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 10:53:31 +00:00
Enforce minimum test coverage (#1646)
## Description: Enforce minimum test coverage. ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I process any text displayed to the user through translateText() and I've added it to the en.json file - [x] I have added relevant tests to the test directory - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced - [ ] I have read and accepted the CLA agreement (only required once).
This commit is contained in:
@@ -41,7 +41,7 @@ jobs:
|
||||
with:
|
||||
node-version: 20
|
||||
- run: npm ci
|
||||
- run: npm test
|
||||
- run: npm run test:coverage
|
||||
|
||||
eslint:
|
||||
name: 🔍 ESLint
|
||||
|
||||
+4
-4
@@ -29,10 +29,10 @@ export default {
|
||||
collectCoverageFrom: ["src/**/*.ts", "!src/**/*.d.ts"],
|
||||
coverageThreshold: {
|
||||
global: {
|
||||
branches: 0,
|
||||
functions: 0,
|
||||
lines: 0,
|
||||
statements: 0,
|
||||
statements: 22.2,
|
||||
branches: 17.5,
|
||||
lines: 22.7,
|
||||
functions: 21.2,
|
||||
},
|
||||
},
|
||||
coverageReporters: ["text", "lcov", "html"],
|
||||
|
||||
@@ -61,10 +61,9 @@ export function createRenderer(
|
||||
if (!emojiTable || !(emojiTable instanceof EmojiTable)) {
|
||||
console.error("EmojiTable element not found in the DOM");
|
||||
}
|
||||
emojiTable.eventBus = eventBus;
|
||||
emojiTable.transformHandler = transformHandler;
|
||||
emojiTable.game = game;
|
||||
emojiTable.initEventBus();
|
||||
emojiTable.initEventBus(eventBus);
|
||||
|
||||
const buildMenu = document.querySelector("build-menu") as BuildMenu;
|
||||
if (!buildMenu || !(buildMenu instanceof BuildMenu)) {
|
||||
|
||||
@@ -12,12 +12,11 @@ import { TransformHandler } from "../TransformHandler";
|
||||
@customElement("emoji-table")
|
||||
export class EmojiTable extends LitElement {
|
||||
@state() public isVisible = false;
|
||||
public eventBus: EventBus;
|
||||
public transformHandler: TransformHandler;
|
||||
public game: GameView;
|
||||
|
||||
initEventBus() {
|
||||
this.eventBus.on(ShowEmojiMenuEvent, (e) => {
|
||||
initEventBus(eventBus: EventBus) {
|
||||
eventBus.on(ShowEmojiMenuEvent, (e) => {
|
||||
this.isVisible = true;
|
||||
const cell = this.transformHandler.screenToWorldCoordinates(e.x, e.y);
|
||||
if (!this.game.isValidCoord(cell.x, cell.y)) {
|
||||
@@ -40,7 +39,7 @@ export class EmojiTable extends LitElement {
|
||||
targetPlayer === this.game.myPlayer()
|
||||
? AllPlayers
|
||||
: (targetPlayer as PlayerView);
|
||||
this.eventBus.emit(
|
||||
eventBus.emit(
|
||||
new SendEmojiIntentEvent(
|
||||
recipient,
|
||||
flattenedEmojiTable.indexOf(emoji),
|
||||
|
||||
Reference in New Issue
Block a user