Skip to content

Commit

Permalink
feat(world): updates to support new data center and world statuses
Browse files Browse the repository at this point in the history
  • Loading branch information
ReidWeb committed Jan 25, 2022
1 parent 136938b commit 603ca2d
Show file tree
Hide file tree
Showing 5 changed files with 299 additions and 115 deletions.
3 changes: 3 additions & 0 deletions src/entity/world/Worlds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ export default class Worlds {
case 2:
region = Region.Europe
break
case 3:
region = Region.Oceania
break
default:
throw Error('Could not find matching region')
}
Expand Down
11 changes: 6 additions & 5 deletions src/entity/world/__tests__/Worlds.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ describe('Worlds', () => {
})

it('should return an array of servers of expected length', () => {
expect(resultantServers.servers.length).toEqual(68)
expect(resultantServers.servers.length).toEqual(73)
})

it('should return array of data centers of expected length', () => {
expect(resultantServers.dataCenters.length).toEqual(8)
expect(resultantServers.dataCenters.length).toEqual(9)
})

describe('when status is not requested', () => {
Expand Down Expand Up @@ -77,9 +77,10 @@ describe('Worlds', () => {
})

describe.each([
['Cerberus', 'Chaos', 'Europe', WorldCategory.Standard, WorldStatus.CreationOfNewCharactersUnavailable],
['Ridill', 'Gaia', 'Japan', WorldCategory.Preferred, WorldStatus.CreationOfNewCharacters],
['Siren', 'Aether', 'North America', WorldCategory.Standard, WorldStatus.CreationOfNewCharacters],
['Cerberus', 'Chaos', 'Europe', WorldCategory.Congested, WorldStatus.CreationOfNewCharactersUnavailable],
['Ridill', 'Gaia', 'Japan', WorldCategory.Standard, WorldStatus.CreationOfNewCharactersUnavailable],
['Ultros', 'Primal', 'North America', WorldCategory.Standard, WorldStatus.CreationOfNewCharacters],
['Bismarck', 'Materia', 'Oceania', WorldCategory.New, WorldStatus.CreationOfNewCharacters],
])('servers array should contain %s', (serverName, dataCenter, region, category, status) => {
let foundServer: World | undefined

Expand Down

0 comments on commit 603ca2d

Please sign in to comment.