<commit_before>import reducer from '../src/reducers'

describe('reducer', () => {
  it('should return the initial state', () => {
    expect(
      reducer(undefined, {})
    ).toEqual({
      context: 'WELCOME',
      joinState: {
        joined: false,
        leader: false,
        username: "",
        roomCode: ""
      }
    })
  })

  describe('context', () => {
    it('should handle SWITCH_CONTEXT', () => {
      expect(
        reducer({}, {
          type: "SWITCH_CONTEXT",
          payload: "DEFCON_5"
        }).context
      ).toEqual("DEFCON_5")
    })
  })

  describe('joinState', () => {
    it('should handle JOIN_ROOM', () => {
      expect(
        reducer({}, {
          type: "JOIN_ROOM",
          payload: {
            username: "Donnie",
            roomCode: "DARK"
          }
        }).joinState
      ).toEqual(expect.objectContaining({
        joined: true,
        username: "Donnie",
        roomCode: "DARK"
      }))
    })
    it('should handle PROMOTE', () => {
      expect(
        reducer({}, {
          type: "PROMOTE"
        }).joinState
      ).toEqual(expect.objectContaining({
        leader: true
      }))
    })
  })
})
<commit_msg>Updated tests to desired behavior<commit_after>import reducer from '../src/reducers'

describe('reducer', () => {
  it('should return the initial state', () => {
    expect(
      reducer(undefined, {})
    ).toEqual({
      context: 'WELCOME',
      joinState: {
        joined: false,
        leader: false,
        username: "",
        roomCode: ""
      },
      geo: {
        boned: true,
        position: null
      }
    })
  })

  describe('context', () => {
    it('should handle SWITCH_CONTEXT', () => {
      expect(
        reducer({}, {
          type: "SWITCH_CONTEXT",
          payload: "DEFCON_5"
        }).context
      ).toEqual("DEFCON_5")
    })
  })

  describe('joinState', () => {
    it('should handle JOIN_ROOM', () => {
      expect(
        reducer({}, {
          type: "JOIN_ROOM",
          payload: {
            username: "Donnie",
            roomCode: "DARK"
          }
        }).joinState
      ).toEqual(expect.objectContaining({
        joined: true,
        username: "Donnie",
        roomCode: "DARK"
      }))
    })
    it('should handle PROMOTE', () => {
      expect(
        reducer({}, {
          type: "PROMOTE"
        }).joinState
      ).toEqual(expect.objectContaining({
        leader: true
      }))
    })
  })

  describe('geo', () => {
    it('should handle UNBONE', () => {
      expect(
        reducer({}, {
          type: "UNBONE"
        }).geo
      ).toEqual(expect.objectContaining({
        boned: false
      }))
    })
    it('should handle POSITION_CHANGED', () => {
      expect(
        reducer({}, {
          type: "POSITION_CHANGED",
          payload: {
            coords: {
              longitude: 3.14,
              latitude: 1.59
            },
            timestamp: 1000
          }
        }).geo
      ).toEqual(expect.objectContaining({
        position: {
          coords: {
            longitude: 3.14,
            latitude: 1.59
          },
          timestamp: 1000
        }
      }))
    })
  })
})

{'fraction_non_alphanumeric': 0.16045126919460984, 'fraction_numerical': 0.007521153243497336, 'mean_word_length': 1.5333333333333334, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 20, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6234370', 'n_tokens_mistral': 1002, 'n_tokens_neox': 976, 'n_words': 178}