-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #84 from toddmedema/create-react-app
Fix bugs from CRA migration with score submission and each game tick counting as new day
- Loading branch information
Showing
6 changed files
with
102 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { formatWatts } from './Format'; | ||
|
||
describe('formatWatts', () => { | ||
it('should correctly format numbers in the tens', () => { | ||
const result = formatWatts(10); | ||
expect(result).toEqual('10W'); | ||
}); | ||
|
||
it('should correctly format numbers in the thousands', () => { | ||
const result = formatWatts(1500); | ||
expect(result).toEqual('1.5kW'); | ||
}); | ||
|
||
it('should correctly format numbers in the millions', () => { | ||
const result = formatWatts(1500000); | ||
expect(result).toEqual('1.5MW'); | ||
}); | ||
|
||
it('should correctly format numbers in the billions', () => { | ||
const result = formatWatts(1500000000); | ||
expect(result).toEqual('1.5GW'); | ||
}); | ||
|
||
it('should correctly format numbers in the trillions', () => { | ||
const result = formatWatts(1500000000000); | ||
expect(result).toEqual('1.5TW'); | ||
}); | ||
|
||
it('should correctly handle the mantissa parameter when 0', () => { | ||
const result = formatWatts(1001, 0); | ||
expect(result).toEqual('1kW'); | ||
}); | ||
|
||
it('should correctly handle the mantissa parameter when 2', () => { | ||
const result = formatWatts(1521, 0); | ||
expect(result).toEqual('1.5kW'); | ||
}); | ||
|
||
it('should correctly handle the mantissa parameter when 3', () => { | ||
const result = formatWatts(1521, 3); | ||
expect(result).toEqual('1.52kW'); | ||
}); | ||
|
||
it('should correctly handle the mantissa parameter when 4', () => { | ||
const result = formatWatts(1521, 4); | ||
expect(result).toEqual('1.521kW'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters