Skip to content

Commit cdbb76d

Browse files
committed
Fix rendering of filename when deleting
1 parent 81b37c0 commit cdbb76d

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

packages/host/app/components/operator-mode/delete-modal.gts

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ export default class DeleteModal extends Component<Signature> {
135135
if (this.item instanceof URL) {
136136
return {
137137
type: 'file',
138-
name: this.item.href.split('/').pop()!,
138+
name: decodeURI(this.item.href).split('/').pop()!,
139139
id: this.item.href,
140140
};
141141
}

packages/host/tests/acceptance/code-submode/inspector-test.ts

+5-4
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,7 @@ module('Acceptance | code submode | inspector tests', function (hooks) {
467467
},
468468
},
469469
},
470+
'léame.md': 'hola mundo',
470471
'readme.md': 'hello world',
471472
'not-json.json': 'I am not JSON.',
472473
'Person/1.json': {
@@ -1226,21 +1227,21 @@ module('Acceptance | code submode | inspector tests', function (hooks) {
12261227
await visitOperatorMode({
12271228
stacks: [[]],
12281229
submode: 'code',
1229-
codePath: `${testRealmURL}readme.md`,
1230+
codePath: `${testRealmURL}léame.md`,
12301231
});
12311232
await waitForCodeEditor();
12321233
assert.dom('[data-test-delete-modal-container]').doesNotExist();
12331234

12341235
await waitFor(`[data-test-action-button="Delete"]`);
12351236
await click('[data-test-action-button="Delete"]');
1236-
await waitFor(`[data-test-delete-modal="${testRealmURL}readme.md"]`);
1237+
await waitFor(`[data-test-delete-modal="${testRealmURL}l%C3%A9ame.md"]`);
12371238
assert
12381239
.dom('[data-test-delete-msg]')
1239-
.includesText('Delete the file readme.md?');
1240+
.includesText('Delete the file léame.md?');
12401241
await click('[data-test-confirm-delete-button]');
12411242
await waitFor('[data-test-empty-code-mode]');
12421243

1243-
let notFound = await adapter.openFile('readme.md');
1244+
let notFound = await adapter.openFile('léame.md');
12441245
assert.strictEqual(notFound, undefined, 'file ref does not exist');
12451246
assert.dom('[data-test-delete-modal-container]').doesNotExist();
12461247
});

0 commit comments

Comments
 (0)