Skip to content

Commit

Permalink
Add Lint tests for PRs (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
srpiatt authored Apr 29, 2024
1 parent 0552582 commit 845fdc5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ jobs:
run: npx playwright install --with-deps
- name: Run Playwright tests
run: npm test
- name: Run linting tests
run: npm run lint
- uses: actions/upload-artifact@v4
if: always()
with:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<script lang="ts">
import type { SvelteComponent } from 'svelte';
import { Step, Stepper, getModalStore } from '@skeletonlabs/skeleton';
const modalStore = getModalStore();
Expand Down
23 changes: 12 additions & 11 deletions src/lib/models/query/Query.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import type { Indexable } from '$lib/types';
type ExpectedResultType = 'COUNT' | 'CROSS_COUNT' | 'DATAFRAME';

interface QueryInterface {
categoryFilters: Object; //TODO: define type
numericFilters: Object;
requiredFields: Object[];
anyRecordOf: Object[];
categoryFilters: object; //TODO: define type
numericFilters: object;
requiredFields: string[];
anyRecordOf: string[];
variantInfoFilters: VariantInfoFilters[];
expectedResultType: ExpectedResultType;
}
Expand All @@ -25,10 +26,10 @@ interface VariantInfoFilters {
}

export class Query implements QueryInterface {
categoryFilters: Object;
numericFilters: Object;
requiredFields: Object[];
anyRecordOf: Object[];
categoryFilters: object;
numericFilters: object;
requiredFields: string[];
anyRecordOf: string[];
variantInfoFilters: VariantInfoFilters[];
expectedResultType: ExpectedResultType;

Expand All @@ -37,7 +38,7 @@ export class Query implements QueryInterface {
this.numericFilters = {};
this.requiredFields = [];
this.anyRecordOf = [];
let variantInfoFilter = {
const variantInfoFilter = {
categoryVariantInfoFilters: {},
numericVariantInfoFilters: {},
};
Expand All @@ -46,11 +47,11 @@ export class Query implements QueryInterface {
}

addCategoryFilter(key: string, value: string[]) {
(this.categoryFilters as { [key: string]: any })[key] = value;
(this.categoryFilters as Indexable)[key] = value;
}

addNumericFilter(key: string, min: string, max: string) {
(this.numericFilters as { [key: string]: any })[key] = {
(this.numericFilters as Indexable)[key] = {
min: min.toString(),
max: max.toString(),
};
Expand Down

0 comments on commit 845fdc5

Please sign in to comment.