Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ export default class DetailPanel extends Component<Signature> {
private get showDetailsPanel() {
return (
this.args.cardError ||
this.args.moduleAnalysis.moduleError ||
(!this.isModule && !isCardDocumentString(this.args.readyFile.content))
);
}
Expand Down
24 changes: 24 additions & 0 deletions packages/host/tests/acceptance/code-submode/inspector-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ const employeeCardSource = `
}
`;

const erroringModuleSource = `throw new Error('boom');`;

const inThisFileSource = `
import {
contains,
Expand Down Expand Up @@ -468,6 +470,7 @@ module('Acceptance | code submode | inspector tests', function (hooks) {
're-export.gts': reExportSource,
'local-inherit.gts': localInheritSource,
'command-module.gts': commandModuleSource,
'erroring-module.gts': erroringModuleSource,
'empty-file.gts': '',
'person-entry.json': {
data: {
Expand Down Expand Up @@ -2161,6 +2164,27 @@ export class ExportedCard extends ExportedCardParent {
assert.dom('[data-test-delete-module-button]').exists();
});

test('can delete an erroring module file', async function (assert) {
await visitOperatorMode({
stacks: [[]],
submode: 'code',
codePath: `${testRealmURL}erroring-module.gts`,
});

await waitFor('[data-test-syntax-error]');
await waitFor('[data-test-action-button="Delete"]');

await click('[data-test-action-button="Delete"]');
await waitFor(
`[data-test-delete-modal="${testRealmURL}erroring-module.gts"]`,
);
await click('[data-test-confirm-delete-button]');
await waitFor('[data-test-empty-code-mode]');

let notFound = await adapter.openFile('erroring-module.gts');
assert.strictEqual(notFound, undefined, 'file ref does not exist');
});

module('when the user lacks write permissions', function (hooks) {
hooks.beforeEach(async function () {
setRealmPermissions({ [testRealmURL]: ['read'] });
Expand Down