<commit_before>describe('Dashboard - feature flag', () => {
  context('when a feature flag is set and your are in the testing team', () => {
    beforeEach(() => {
      cy.setUserDitTeam('1234')
      cy.setFeatureFlag('layoutTesting:1234', true)
      cy.visit('/')
    })
    it('should show an alternative layout', () => {
      cy.get('[data-test="dashboard"]').should('be.visible')
    })
    it('should append a query param for GA tracking', () => {
      cy.url('[data-test="dashboard"]').should(
        'contain',
        '?layoutTesting=dashboard'
      )
    })
  })

  context(
    'when a feature flag is set and your are NOT in the testing team',
    () => {
      beforeEach(() => {
        cy.resetUserDitTeam()
        cy.setFeatureFlag('layoutTesting:1234', true)
        cy.visit('/')
      })
      it('should show the default dashboard layout', () => {
        cy.get('[data-test="dashboard"]').should('not.be.visible')
      })
      it('should NOT append a query param for GA tracking', () => {
        cy.url('[data-test="dashboard"]').should(
          'not.contain',
          '?layoutTesting=dashboard'
        )
      })
    }
  )

  context('when there is no feature flag', () => {
    beforeEach(() => {
      cy.resetUserDitTeam()
      cy.resetFeatureFlags()
      cy.visit('/')
    })
    it('should show the default dashboard layout', () => {<commit_msg>Move teardown to afterEach lifecycle hook<commit_after>describe('Dashboard - feature flag', () => {
  context('when a feature flag is set and your are in the testing team', () => {
    beforeEach(() => {
      cy.setUserDitTeam('1234')
      cy.setFeatureFlag('layoutTesting:1234', true)
      cy.visit('/')
    })
    afterEach(() => {
      cy.resetUserDitTeam()
    })
    it('should show an alternative layout', () => {
      cy.get('[data-test="dashboard"]').should('be.visible')
    })
    it('should append a query param for GA tracking', () => {
      cy.url('[data-test="dashboard"]').should(
        'contain',
        '?layoutTesting=dashboard'
      )
    })
  })

  context(
    'when a feature flag is set and your are NOT in the testing team',
    () => {
      beforeEach(() => {
        cy.setFeatureFlag('layoutTesting:1234', true)
        cy.visit('/')
      })
      it('should show the default dashboard layout', () => {
        cy.get('[data-test="dashboard"]').should('not.be.visible')
      })
      it('should NOT append a query param for GA tracking', () => {
        cy.url('[data-test="dashboard"]').should(
          'not.contain',
          '?layoutTesting=dashboard'
        )
      })
    }
  )

  context('when there is no feature flag', () => {
    beforeEach(() => {
      cy.resetUserDitTeam()
      cy.resetFeatureFlags()
      cy.visit('/')
    })
    it('should show the default dashboard layout', () => {
{'fraction_non_alphanumeric': 0.1757853865160607, 'fraction_numerical': 0.008471584892340275, 'mean_word_length': 2.4645476772616135, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 28, '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': '6540762', 'n_tokens_mistral': 860, 'n_tokens_neox': 847, 'n_words': 192}