Skip to content

Commit

Permalink
Dismiss the need of from backend
Browse files Browse the repository at this point in the history
  • Loading branch information
campos20 committed Sep 9, 2020
1 parent 6674fca commit 85bc9af
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 6 additions & 2 deletions tnoodle-ui/src/components/VersionInfo.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,14 @@ const VersionInfo = connect(
fetchRunningVersion()
.then((response) => response.json())
.then((version) => {
let { runningVersion, signedBuild } = version;
let { projectName, projectVersion, signedBuild } = version;
this.setState({
...this.state,
runningVersion,
// Running version is based on projectName and projectVersion
runningVersion:
projectVersion != null && projectVersion != null
? `${projectName}-${projectVersion}`
: "",
officialBuild: signedBuild,
});
})
Expand Down
4 changes: 0 additions & 4 deletions tnoodle-ui/src/components/VersionInfo.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ afterEach(() => {
it("Current version is the correct one", async () => {
// Define mock objects
const version = {
runningVersion: "TNoodle-WCA-2",
projectName: "TNoodle-WCA",
projectVersion: "2",
signedBuild: true,
Expand Down Expand Up @@ -79,7 +78,6 @@ it("Current version is the correct one", async () => {

it("Current version is allowed, but it's not the latest one", async () => {
const version = {
runningVersion: "TNoodle-WCA-2",
projectName: "TNoodle-WCA",
projectVersion: "2",
signedBuild: true,
Expand Down Expand Up @@ -137,7 +135,6 @@ it("Current version is allowed, but it's not the latest one", async () => {

it("Not official version alert", async () => {
const version = {
runningVersion: "TNoodle-WCA-3",
projectName: "TNoodle-WCA",
projectVersion: "3",
signedBuild: false, // This should trigger an alert, even with currentVersion == runningVersion
Expand Down Expand Up @@ -192,7 +189,6 @@ it("Not official version alert", async () => {

it("Not allowed TNoodle version, despite it's official", async () => {
const version = {
runningVersion: "TNoodle-WCA-1",
projectName: "TNoodle-WCA",
projectVersion: "1",
signedBuild: true,
Expand Down

0 comments on commit 85bc9af

Please sign in to comment.