Skip to content

Commit 41c606e

Browse files
authored
Feature/infected update (#13)
* add infected to default filter * fix banner
1 parent 6bcf746 commit 41c606e

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

build.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ async function run() {
8080

8181
copyStatic("css/styles.css");
8282
copyStatic("robots.txt");
83+
copyStatic("data/banner2_1920x200.png")
8384
copyImages("data/icons/","data/icons/")
8485
}
8586

src/js/main.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@ let unlockSlider;
33
let rankSlider;
44
let seenUnitNames = new Set();
55

6-
const excludeOthers = [
6+
const excludeOthers = new Set([
77
"The Ridgy-Didge",
88
"Promotional",
99
"SpecOps CenterPromotional",
10-
"Infection Test Facility",
1110
"Mercenary Vault",
1211
"Missile Silo",
1312
"The Way to a Bigfoot's Heart...",
@@ -19,7 +18,7 @@ const excludeOthers = [
1918
"The Frontier Jubilee Charity Drive",
2019
"Boss Strike",
2120
"Arena Challenge 1"
22-
];
21+
]);
2322

2423
document.addEventListener('DOMContentLoaded', function () {
2524
// Unlock level range filtering
@@ -164,7 +163,7 @@ document.getElementById('currentVersionBtn').addEventListener('click', () => {
164163

165164
// Select options NOT in excludeOthers
166165
for (const option of otherFilter.options) {
167-
if (!excludeOthers.includes(option.value)) {
166+
if (!excludeOthers.has(option.value)) {
168167
option.selected = true;
169168
}
170169
}

tests/currentVersion.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { test, expect } from '@playwright/test';
33
test('test', async ({ page }) => {
44
await page.goto('http://localhost:8080/');
55
await page.getByTestId('current-version-btn').click();
6-
await expect(page.getByTestId('other-filter-wrapper').getByRole('textbox')).toHaveValue('(none), How to Kill People From Quite a Long Way Away, Weapons Factory, Rocket Factory, SpecOps Center, Chemical Weapons Lab, Gun Foundry, Raptor Ranch, Boar Pen, Mammoth Pen, Sandworm Ranch, Armor ShopGun Foundry, Armor Shop, Armor ShopChemical Weapons Lab, Reef Bandit Armory');
6+
await expect(page.getByTestId('other-filter-wrapper').getByRole('textbox')).toHaveValue('(none), How to Kill People From Quite a Long Way Away, Weapons Factory, Rocket Factory, SpecOps Center, Chemical Weapons Lab, Gun Foundry, Raptor Ranch, Boar Pen, Mammoth Pen, Sandworm Ranch, Infection Test Facility, Armor ShopGun Foundry, Armor Shop, Armor ShopChemical Weapons Lab, Reef Bandit Armory');
77
await expect(page.locator('#unlock-range-display')).toContainText('Level: 0 - 46');
88
const firstCell = await page.getByRole('cell', { name: 'Trooper', exact: true }).first().textContent();
99
expect(firstCell?.trim()).toBe('Trooper');

tests/reset.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {expect, test} from '@playwright/test';
33
test('test', async ({page}) => {
44
await page.goto('http://localhost:8080/');
55
await page.getByTestId('current-version-btn').click();
6-
await expect(page.getByTestId('other-filter-wrapper').getByRole('textbox')).toHaveValue('(none), How to Kill People From Quite a Long Way Away, Weapons Factory, Rocket Factory, SpecOps Center, Chemical Weapons Lab, Gun Foundry, Raptor Ranch, Boar Pen, Mammoth Pen, Sandworm Ranch, Armor ShopGun Foundry, Armor Shop, Armor ShopChemical Weapons Lab, Reef Bandit Armory');
6+
await expect(page.getByTestId('other-filter-wrapper').getByRole('textbox')).toHaveValue('(none), How to Kill People From Quite a Long Way Away, Weapons Factory, Rocket Factory, SpecOps Center, Chemical Weapons Lab, Gun Foundry, Raptor Ranch, Boar Pen, Mammoth Pen, Sandworm Ranch, Infection Test Facility, Armor ShopGun Foundry, Armor Shop, Armor ShopChemical Weapons Lab, Reef Bandit Armory');
77
await page.getByText('Hide ranked').click();
88
await page.getByText('Show Unique Units Only').click();
99
await page.getByText('Owned only').click();
@@ -20,7 +20,7 @@ test('test', async ({page}) => {
2020
await page.getByTestId("username").fill("test");
2121
await expect(page.getByTestId('rank-filter-wrapper').getByRole('textbox')).toHaveValue('4, 5');
2222
await expect(page.getByTestId('nanopods-filter-wrapper').getByRole('textbox')).toHaveValue('All');
23-
await expect(page.getByTestId('other-filter-wrapper').getByRole('textbox')).toHaveValue('(none), How to Kill People From Quite a Long Way Away, Weapons Factory, Rocket Factory, SpecOps Center, Chemical Weapons Lab, Gun Foundry, Raptor Ranch, Boar Pen, Mammoth Pen, Sandworm Ranch, Armor ShopGun Foundry, Armor Shop, Armor ShopChemical Weapons Lab, Reef Bandit Armory');
23+
await expect(page.getByTestId('other-filter-wrapper').getByRole('textbox')).toHaveValue('(none), How to Kill People From Quite a Long Way Away, Weapons Factory, Rocket Factory, SpecOps Center, Chemical Weapons Lab, Gun Foundry, Raptor Ranch, Boar Pen, Mammoth Pen, Sandworm Ranch, Infection Test Facility, Armor ShopGun Foundry, Armor Shop, Armor ShopChemical Weapons Lab, Reef Bandit Armory');
2424
await expect(page.getByTestId('category-filter-wrapper').getByRole('textbox')).toHaveValue('infected, defense');
2525
await expect(page.getByTestId('building-filter-wrapper').getByRole('textbox')).toHaveValue('Barrackslevel 5, Barrackslevel 7');
2626
await expect(page.getByTestId('checkbox-filter-owned')).toBeChecked();

0 commit comments

Comments
 (0)