Skip to content

Add some tests#202

Open
MoellJ wants to merge 2 commits into
taibeled:masterfrom
MoellJ:some-tests
Open

Add some tests#202
MoellJ wants to merge 2 commits into
taibeled:masterfrom
MoellJ:some-tests

Conversation

@MoellJ

@MoellJ MoellJ commented Mar 8, 2026

Copy link
Copy Markdown

To get aquanited with the code base in preperation for #192 this PR adds some tests for:

  • Some geo functions
  • RadiusQuestion
  • ThermometerQuestion
  • Trash button

(Related to #36 but only covers some parts of the code)

(Disclaimer: I'm not super experienced with web development and used LLMs for the first drafts of these tests but rewrote most of the code myself.)

@taibeled

Copy link
Copy Markdown
Owner

Although I agree that tests are important, some of these tests seem so simple that they aren't warranted. For instance,

describe("convertToLongLat", () => {
    it("converts valid LatLngTuple to [lng, lat] array", () => {
        const input: LatLngTuple = [35, 139];
        const result = convertToLongLat(input);
        expect(result).toEqual([139, 35]);
    });

    it("handles negative coordinates", () => {
        const input: LatLngTuple = [-33, -151];
        const result = convertToLongLat(input);
        expect(result).toEqual([-151, -33]);
    });
});

For me, I would prefer excluding minor tests like with the above. Could you try to prune through the ones you've suggested to see which tests don't deal with any potentially problematic code, please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants