import { isTrashedMediaPath } from './storage.config';

describe('isTrashedMediaPath', () => {
  it('blocks the trashed-media tree however the path is spelled', () => {
    for (const p of [
      '/deleted/acme/hotels/1-a.jpg',
      '//deleted/acme/hotels/1-a.jpg',
      '/DELETED/acme/hotels/1-a.jpg',
      '/%64eleted/acme/hotels/1-a.jpg',
      '/deleted',
      '/%E0%A4%A',
    ]) {
      expect(isTrashedMediaPath(p)).toBe(true);
    }
  });

  it('allows live tenant files', () => {
    expect(isTrashedMediaPath('/acme/hotels/1-a.jpg')).toBe(false);
    expect(isTrashedMediaPath('/acme/deleted.jpg')).toBe(false);
  });
});
