void () { Project project = getProject(); EncodingPanel panel = new EncodingPanel(project, project.getCoroutineScope()) { @Override protected VirtualFile getSelectedFile() { LightVirtualFile file = new LightVirtualFile("x.txt", "xxx"); file.setWritable(false); return file; } }; panel.updateInTests(true); assertTrue(panel.isActionEnabled()); Disposer.dispose(panel); }