Skip to content

Commit

Permalink
Update Team object with improved team name mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
CarolinaGuy89 authored and mkreiser committed Oct 21, 2023
1 parent c6d4ee9 commit 1b63e4a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 19 deletions.
5 changes: 1 addition & 4 deletions src/team/team.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,7 @@ class Team extends BaseCacheableObject {
static responseMap = {
id: 'id',
abbreviation: 'abbrev',
name: {
key: 'location',
manualParse: (responseData, data) => `${_.trim(data.location)} ${_.trim(data.nickname)}`
},
name: 'name',
logoURL: 'logo',
wavierRank: 'wavierRank',

Expand Down
15 changes: 0 additions & 15 deletions src/team/team.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,21 +42,6 @@ describe('Team', () => {
describe('responseMap', () => {
const buildTeam = (data, options) => Team.buildFromServer(data, options);

describe('name', () => {
describe('manualParse', () => {
test('interpolates location and nickname into a single string', () => {
const data = {
location: ' First ',
nickname: ' Last ',
name: 'This is not used'
};
const team = buildTeam(data);

expect(team.name).toBe(`${_.trim(data.location)} ${_.trim(data.nickname)}`);
});
});
});

describe('roster', () => {
describe('manualParse', () => {
test('returns an array of players', () => {
Expand Down

0 comments on commit 1b63e4a

Please sign in to comment.