<commit_before>import { expect } from 'chai';
import { Map } from 'immutable';

import reducer from 'webapp/reducers/RenderReducer';
import { WIREFRAME_TOGGLE, AUTO_ROTATE_TOGGLE, SHADING_TOGGLE } from 'webapp/actions/types';

describe('Render Reducer', () => {
  it('Should return the initial state', () => {
    expect(reducer(undefined, {})).to.equal(Map({
      wireframe: false,
      shadingMode: 0,
      autoRotate: false,
      resetViewToggle: false,
      playbackWalkthroughToggle: false
    }));
  });

  describe('#Action: WIREFRAME_TOGGLE', () => {
    it('Should handle WIREFRAME_TOGGLE toggling from TRUE to FALSE', () => {
      expect(
        reducer(Map({ wireframe: true }), { type: WIREFRAME_TOGGLE })
      ).to.equal(
        Map({ wireframe: false })
      );
    });

    it('Should handle WIREFRAME_TOGGLE toggling from FALSE to TRUE', () => {
      expect(
        reducer(Map({ wireframe: false }), { type: WIREFRAME_TOGGLE })
      ).to.equal(
        Map({ wireframe: true })
      );
    });
  });

  describe('#Action: SHADING_TOGGLE', () => {
    it('Should handle SHADING_TOGGLE by incrementing shading type', () => {
      expect(
        reducer(Map({ shadingMode: 0 }), { type: SHADING_TOGGLE })
      ).to.equal(
        Map({ shadingMode: 1 })
      );

      expect(
        reducer(Map({ shadingMode: 1 }), { type: SHADING_TOGGLE })
      ).to.equal(
        Map({ shadingMode: 2 })
      );

      expect(
        reducer(Map({ shadingMode: 2 }), { type: SHADING_TOGGLE })
      ).to.equal(
        Map({ shadingMode: 3 })
      );

      expect(
        reducer(Map({ shadingMode: 3 }), { type: SHADING_TOGGLE })
      ).to.equal(
        Map({ shadingMode: 0 })
      );
    });
  });

  describe('#Action: AUTO_ROTATE_TOGGLE', () => {
    it('Should handle AUTO_ROTATE_TOGGLE toggling from TRUE to FALSE', () => {
      expect(
        reducer(Map({ autoRotate: true }), { type: AUTO_ROTATE_TOGGLE })
      ).to.equal(
        Map({ autoRotate: false })
      );
    });

    it('Should handle AUTO_ROTATE_TOGGLE toggling from FALSE to TRUE', () => {
      expect(
        reducer(Map({ autoRotate: false }), { type: AUTO_ROTATE_TOGGLE })
      ).to.equal(
        Map({ autoRotate: true })
      );
    });
  });
});<commit_msg>[Update] Updated test cases for resize texture button<commit_after>import { expect } from 'chai';
import { Map } from 'immutable';

import reducer from 'webapp/reducers/RenderReducer';
import {
  WIREFRAME_TOGGLE,
  AUTO_ROTATE_TOGGLE,
  SHADING_TOGGLE,
  TEXTURE_TOGGLE
} from 'webapp/actions/types';

describe('Render Reducer', () => {
  it('Should return the initial state', () => {
    expect(reducer(undefined, {})).to.equal(Map({
      wireframe: false,
      shadingMode: 0,
      autoRotate: false,
      resetViewToggle: false,
      playbackWalkthroughToggle: false,
      resizedTexture: false
    }));
  });

  describe('#Action: WIREFRAME_TOGGLE', () => {
    it('Should handle WIREFRAME_TOGGLE toggling from TRUE to FALSE', () => {
      expect(
        reducer(Map({ wireframe: true }), { type: WIREFRAME_TOGGLE })
      ).to.equal(
        Map({ wireframe: false })
      );
    });

    it('Should handle WIREFRAME_TOGGLE toggling from FALSE to TRUE', () => {
      expect(
        reducer(Map({ wireframe: false }), { type: WIREFRAME_TOGGLE })
      ).to.equal(
        Map({ wireframe: true })
      );
    });
  });

  describe('#Action: SHADING_TOGGLE', () => {
    it('Should handle SHADING_TOGGLE by incrementing shading type', () => {
      expect(
        reducer(Map({ shadingMode: 0 }), { type: SHADING_TOGGLE })
      ).to.equal(
        Map({ shadingMode: 1 })
      );

      expect(
        reducer(Map({ shadingMode: 1 }), { type: SHADING_TOGGLE })
      ).to.equal(
        Map({ shadingMode: 2 })
      );

      expect(
        reducer(Map({ shadingMode: 2 }), { type: SHADING_TOGGLE })
      ).to.equal(
        Map({ shadingMode: 3 })
      );

      expect(
        reducer(Map({ shadingMode: 3 }), { type: SHADING_TOGGLE })
      ).to.equal(
        Map({ shadingMode: 0 })
      );
    });
  });

  describe('#Action: AUTO_ROTATE_TOGGLE', () => {
    it('Should handle AUTO_ROTATE_TOGGLE toggling from TRUE to FALSE', () => {
      expect(
        reducer(Map({ autoRotate: true }), { type: AUTO_ROTATE_TOGGLE })
      ).to.equal(
        Map({ autoRotate: false })
      );
    });

    it('Should handle AUTO_ROTATE_TOGGLE toggling from FALSE to TRUE', () => {
      expect(
        reducer(Map({ autoRotate: false }), { type: AUTO_ROTATE_TOGGLE })
      ).to.equal(
        Map({ autoRotate: true })
      );
    });
  });

  describe('#Action: TEXTURE_TOGGLE', () => {
    it('Should handle TEXTURE_TOGGLE toggling from TRUE to FALSE', () => {
      expect(
        reducer(Map({ resizedTexture: true }), { type: TEXTURE_TOGGLE })
      ).to.equal(
        Map({ resizedTexture: false })
      );
    });

    it('Should handle TEXTURE_TOGGLE toggling from FALSE to TRUE', () => {
      expect(
        reducer(Map({ resizedTexture: false }), { type: TEXTURE_TOGGLE })
      ).to.equal(
        Map({ resizedTexture: true })
      );
    });
  });
});
{'fraction_non_alphanumeric': 0.15722297427963644, 'fraction_numerical': 0.0034809514600657515, 'mean_word_length': 2.5159755268524813, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 26, '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': '123112', 'n_tokens_mistral': 1780, 'n_tokens_neox': 1742, 'n_words': 372}