Skip to content

Commit

Permalink
Remove no-longer-relevant Stanies test.
Browse files Browse the repository at this point in the history
  • Loading branch information
jsoules committed Jul 16, 2024
1 parent a6b48c3 commit c48b60d
Showing 1 changed file with 0 additions and 31 deletions.
31 changes: 0 additions & 31 deletions gui/test/app/Project/ProjectReducer.test.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import {
defaultSamplingOpts,
getStringKnownFileKeys,
initialDataModel,
ProjectDataModel,
ProjectKnownFiles,
SamplingOpts,
} from "@SpCore/ProjectDataModel";
import ProjectReducer, { ProjectReducerAction } from "@SpCore/ProjectReducer";
import exampleStanies from "@SpExamples/exampleStanies";
import { afterEach, describe, expect, test, vi } from "vitest";

const mockedConsoleError = vi
Expand Down Expand Up @@ -47,35 +45,6 @@ const ephemeralFiles = {
};

describe("Project reducer", () => {
describe("Loading example Stan project", () => {
// This will be a little brittle, since the example is only defined as
// data in another file.
const example = exampleStanies[0];
const loadExampleAction: ProjectReducerAction = {
type: "loadStanie",
stanie: example,
};
const dataFileContent = JSON.stringify(example.data, null, 2);

test("Loads example Stan project", () => {
const result = ProjectReducer(fakeEmptyProjectData, loadExampleAction);
expect(result.stanFileContent).toEqual(example.stan);
expect(result.dataFileContent).toEqual(dataFileContent);
expect(result.samplingOpts).toEqual(defaultSamplingOpts);
expect(result.meta).toEqual(example.meta);
expect(result.ephemera).toEqual({
stanFileContent: example.stan,
dataFileContent,
});
});

test("Sets loaded project title to 'Untitled' if missing", () => {
const load = { ...loadExampleAction, stanie: { ...example, meta: {} } };
const result = ProjectReducer(fakeEmptyProjectData, load);
expect(result.meta.title).toBe("Untitled");
});
});

describe("Loading project from files", () => {
const mockFiles = { stanFileContent: "stan file stuff" };
const loadAction: ProjectReducerAction = {
Expand Down

0 comments on commit c48b60d

Please sign in to comment.