Merge pull request #16062 from overleaf/jdt-ieee-eslint-fix
fix: missing setting on test causing eslint failure GitOrigin-RevId: fff96acd389cfe30a1e89404a08a87543f503089
This commit is contained in:
committed by
Copybot
parent
24261ac617
commit
5c84ea8895
@@ -46,6 +46,7 @@ describe('<EditorLeftMenu />', function () {
|
||||
window.metaAttributesCache.set('ol-anonymous', false)
|
||||
window.metaAttributesCache.set('ol-gitBridgeEnabled', true)
|
||||
window.metaAttributesCache.set('ol-showSupport', true)
|
||||
window.metaAttributesCache.set('ol-ExposedSettings', { ieeeBrandId: 123 })
|
||||
window.metaAttributesCache.set('ol-user', {
|
||||
email: 'sherlock@holmes.co.uk',
|
||||
first_name: 'Sherlock',
|
||||
@@ -849,6 +850,7 @@ describe('<EditorLeftMenu />', function () {
|
||||
},
|
||||
})
|
||||
window.metaAttributesCache.set('ol-anonymous', true)
|
||||
window.metaAttributesCache.set('ol-ExposedSettings', { ieeeBrandId: 123 })
|
||||
|
||||
cy.mount(
|
||||
<EditorProviders scope={scope}>
|
||||
|
||||
+32
@@ -5,6 +5,9 @@ import SettingsOverallTheme from '../../../../../../frontend/js/features/editor-
|
||||
import type { OverallThemeMeta } from '../../../../../../types/project-settings'
|
||||
import { renderWithEditorContext } from '../../../../helpers/render-with-context'
|
||||
|
||||
const IEEE_BRAND_ID = 1234
|
||||
const OTHER_BRAND_ID = 2234
|
||||
|
||||
describe('<SettingsOverallTheme />', function () {
|
||||
const overallThemes: OverallThemeMeta[] = [
|
||||
{
|
||||
@@ -21,6 +24,9 @@ describe('<SettingsOverallTheme />', function () {
|
||||
|
||||
beforeEach(function () {
|
||||
window.metaAttributesCache.set('ol-overallThemes', overallThemes)
|
||||
window.metaAttributesCache.set('ol-ExposedSettings', {
|
||||
ieeeBrandId: IEEE_BRAND_ID,
|
||||
})
|
||||
})
|
||||
|
||||
afterEach(function () {
|
||||
@@ -38,4 +44,30 @@ describe('<SettingsOverallTheme />', function () {
|
||||
expect(option.getAttribute('value')).to.equal(theme.val)
|
||||
}
|
||||
})
|
||||
describe('Branded Project', function () {
|
||||
it('should hide overall theme picker for IEEE branded projects', function () {
|
||||
window.metaAttributesCache.set('ol-brandVariation', {
|
||||
brand_id: IEEE_BRAND_ID,
|
||||
})
|
||||
renderWithEditorContext(<SettingsOverallTheme />)
|
||||
const select = screen.queryByText('Overall theme')
|
||||
expect(select).to.not.exist
|
||||
})
|
||||
|
||||
it('should show overall theme picker for branded projects that are not IEEE', function () {
|
||||
window.metaAttributesCache.set('ol-brandVariation', {
|
||||
brand_id: OTHER_BRAND_ID,
|
||||
})
|
||||
renderWithEditorContext(<SettingsOverallTheme />)
|
||||
const select = screen.getByLabelText('Overall theme')
|
||||
expect(select).to.exist
|
||||
})
|
||||
|
||||
it('should show overall theme picker for non branded projects', function () {
|
||||
window.metaAttributesCache.set('ol-brandVariation', undefined)
|
||||
renderWithEditorContext(<SettingsOverallTheme />)
|
||||
const select = screen.getByLabelText('Overall theme')
|
||||
expect(select).to.exist
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user