Skip to content

Commit

Permalink
Ensure that image building fails if typescript check fails. (#1836)
Browse files Browse the repository at this point in the history
  • Loading branch information
absoludity committed Jul 1, 2020
1 parent 6fcf914 commit b5ed425
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion dashboard/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ RUN mkdir /app/src
RUN curl -L https://unpkg.com/@bitnami/hex@3.2.0/dist/hex.min.css > /app/src/hex.min.css
RUN curl -L https://unpkg.com/@clr/ui@3.1.4/clr-ui.min.css > /app/src/clr-ui.min.css
COPY . /app
RUN yarn run prettier-check
RUN yarn run prettier-check && yarn run ts-compile-check
RUN yarn run build

FROM bitnami/nginx:1.18.0-debian-10-r38
Expand Down
1 change: 1 addition & 0 deletions dashboard/src/components/AppView/AppView.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ describe("AppViewComponent", () => {
error: undefined,
getAppWithUpdateInfo: jest.fn(),
namespace: "my-happy-place",
cluster: "default",
releaseName: "mr-sunshine",
push: jest.fn(),
};
Expand Down
2 changes: 1 addition & 1 deletion dashboard/src/components/ConfigLoader/ConfigLoader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import LoadingWrapper, {
} from "../../components/LoadingWrapper/LoadingWrapper";

interface IConfigLoaderProps extends ILoadingWrapperProps {
children: JSX.Element;
children?: JSX.Element;
getConfig: () => void;
error?: Error;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,24 @@ const makeStore = (apps: any, repos: any) => {
});
};

const defaultMatch = {
params: {
cluster: "default",
namespace: "default",
releaseName: "foo",
},
};

describe("LoginFormContainer props", () => {
it("repoName is empty if no apps nor repos are available", () => {
const store = makeStore({}, { errors: {}, repo: {} });
const match = { params: { namespace: "default", releaseName: "foo" } };
const wrapper = shallow(<Upgrade store={store} match={match} />);
const wrapper = shallow(<Upgrade store={store} match={defaultMatch} />);
expect(wrapper.find(AppUpgrade).prop("repoName")).toBe(undefined);
});

it("repoName is set using the selected repo", () => {
const store = makeStore({}, { errors: {}, repo: { metadata: { name: "stable" } } });
const match = { params: { namespace: "default", releaseName: "foo" } };
const wrapper = shallow(<Upgrade store={store} match={match} />);
const wrapper = shallow(<Upgrade store={store} match={defaultMatch} />);
expect(wrapper.find(AppUpgrade).prop("repoName")).toBe("stable");
});

Expand All @@ -43,8 +49,7 @@ describe("LoginFormContainer props", () => {
{ selected: { updateInfo: { repository: { name: "bitnami" } } } },
{ errors: {}, repo: {} },
);
const match = { params: { namespace: "default", releaseName: "foo" } };
const wrapper = shallow(<Upgrade store={store} match={match} />);
const wrapper = shallow(<Upgrade store={store} match={defaultMatch} />);
expect(wrapper.find(AppUpgrade).prop("repoName")).toBe("bitnami");
});
});
1 change: 1 addition & 0 deletions dashboard/src/reducers/cluster.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ describe("clusterReducer", () => {
payload: {
location: { ...location, pathname: tc.path },
action: "PUSH" as RouterActionType,
isFirstRendering: true,
},
}),
).toEqual({
Expand Down

0 comments on commit b5ed425

Please sign in to comment.