Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HtmlEditor: make localization working for borderStyle selectbox if messages are loaded at runtime (T1234032) #28854

Open
wants to merge 2 commits into
base: 25_1
Choose a base branch
from

Conversation

nikkithelegendarypokemonster
Copy link
Contributor

No description provided.

@nikkithelegendarypokemonster nikkithelegendarypokemonster requested a review from a team January 28, 2025 10:24
@ksercs ksercs changed the title HTML-Editor: Localization fix for toolbar selectbox (T1234032) HtmlEditor: make localization working for borderStyle selectbox if messages are loaded at runtime (T1234032) Jan 29, 2025
};
}
}, () => {
test('SelectBox should show correct localization (T1234032)', function(assert) {
Copy link
Contributor

@ksercs ksercs Jan 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[to common test name]

Suggested change
test('SelectBox should show correct localization (T1234032)', function(assert) {
test('borderStyle selectbox items are localized even if messages are loaded at runtime (T1234032)', function(assert) {

test('SelectBox should show correct localization (T1234032)', function(assert) {
try {
localization.loadMessages(this.messages);
localization.locale('de');
Copy link
Contributor

@ksercs ksercs Jan 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[refactoring]
let's get rid of try/finally and just do this localization stuff in beforeEach/afterEach


assert.strictEqual($firstListItem.text(), 'Test', 'borderStyleEditor is correctly localized');
} finally {
localization.locale();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[mistake]
U call getter here, it does not change locale. You should pass a parameter to change locale

showCellPropertiesForm(this.instance, $tableElement);
this.clock.tick(10);

const $borderStyleSelectBox = $(`.${SELECT_BOX_CONTAINER_CLASS} > input`);
Copy link
Contributor

@ksercs ksercs Jan 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[refactoring]
Kindly check how other tests in this file are written. I think you can avoid searching though DOM and just get necessary editor though API and check its items property

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants