Files
zeekayandHanzo Dev f888991a7a drop the Sentry wordmark from the react app
FSL-1.0-Apache-2.0 grants us the code, not the name. "Sentry" is
Functional Software's trademark, so every place the running app says it
to a user -- page titles, onboarding, empty states, toasts, settings
copy, the self-hosted footer -- now says Sentinel.

Attribution is the other half of the deal and stays untouched: upstream
copyright headers, LICENSE, NOTICE. So does anything where the mark is a
fact rather than a brand -- @sentry/* packages, sentry-cli, the wizard
and bundler plugins, docs.sentry.io, the whole gettingStartedDocs tree.
Renaming those would leave instructions that no longer work.

Nothing structural moved. No import, identifier, route path, feature
flag, API field or test id changed; the diff is 312 lines in and 312
out. Colocated specs were updated in lockstep with the copy they assert.
Marketing and community links point at hanzo.ai, only where a real page
exists to point at.

Co-authored-by: Hanzo Dev <[email protected]>
2026-08-10 18:01:22 -07:00

142 lines
4.5 KiB
TypeScript

import {AuditLogsFixture} from 'sentry-fixture/auditLogs';
import {AuditLogsApiEventNamesFixture} from 'sentry-fixture/auditLogsApiEventNames';
import {UserFixture} from 'sentry-fixture/user';
import {initializeOrg} from 'sentry-test/initializeOrg';
import {
render,
screen,
userEvent,
waitForElementToBeRemoved,
} from 'sentry-test/reactTestingLibrary';
import OrganizationAuditLog from 'sentry/views/settings/organizationAuditLog';
// XXX(epurkhiser): This appears to also be tested by ./index.spec.tsx
describe('OrganizationAuditLog', function () {
const {routerContext, organization, router} = initializeOrg({
projects: [],
router: {
params: {orgId: 'org-slug'},
},
});
const ENDPOINT = `/organizations/${organization.slug}/audit-logs/`;
beforeEach(function () {
MockApiClient.clearMockResponses();
MockApiClient.addMockResponse({
url: ENDPOINT,
body: {rows: AuditLogsFixture(), options: AuditLogsApiEventNamesFixture()},
});
});
it('renders', async function () {
render(<OrganizationAuditLog location={router.location} />, {
context: routerContext,
});
expect(await screen.findByRole('heading')).toHaveTextContent('Audit Log');
expect(screen.getByRole('textbox')).toBeInTheDocument();
expect(screen.getByText('Member')).toBeInTheDocument();
expect(screen.getByText('Action')).toBeInTheDocument();
expect(screen.getByText('IP')).toBeInTheDocument();
expect(screen.getByText('Time')).toBeInTheDocument();
expect(screen.queryByText('No audit entries available')).not.toBeInTheDocument();
expect(screen.getByText('edited project ludic-science')).toBeInTheDocument();
});
it('renders empty', async function () {
MockApiClient.clearMockResponses();
MockApiClient.addMockResponse({
url: ENDPOINT,
body: {rows: [], options: AuditLogsApiEventNamesFixture()},
});
render(<OrganizationAuditLog location={router.location} />, {
context: routerContext,
});
expect(await screen.findByText('No audit entries available')).toBeInTheDocument();
});
it('displays whether an action was done by a superuser', async () => {
render(<OrganizationAuditLog location={router.location} />, {
context: routerContext,
});
expect(await screen.findByText('Sentinel Staff')).toBeInTheDocument();
expect(screen.getAllByText('Foo Bar')).toHaveLength(2);
});
it('replaces rule and alertrule audit types in dropdown', async function () {
MockApiClient.clearMockResponses();
MockApiClient.addMockResponse({
url: ENDPOINT,
body: {
rows: AuditLogsFixture(),
options: ['rule.edit', 'alertrule.edit', 'member.add'],
},
});
render(<OrganizationAuditLog location={router.location} />, {
context: routerContext,
});
await userEvent.click(screen.getByText('Select Action:'));
expect(screen.getByText('issue-alert.edit')).toBeInTheDocument();
expect(screen.getByText('metric-alert.edit')).toBeInTheDocument();
expect(screen.getByText('member.add')).toBeInTheDocument();
});
it('replaces text in rule and alertrule entries', async function () {
MockApiClient.clearMockResponses();
MockApiClient.addMockResponse({
url: `/organizations/org-slug/audit-logs/`,
method: 'GET',
body: {
rows: [
{
actor: UserFixture(),
event: 'rule.edit',
ipAddress: '127.0.0.1',
id: '214',
note: 'edited rule "New issue"',
targetObject: 123,
targetUser: null,
data: {},
},
{
actor: UserFixture(),
event: 'alertrule.edit',
ipAddress: '127.0.0.1',
id: '215',
note: 'edited metric alert rule "Failure rate too high"',
targetObject: 456,
targetUser: null,
data: {},
},
],
options: AuditLogsApiEventNamesFixture(),
},
});
render(<OrganizationAuditLog location={router.location} />, {
context: routerContext,
});
await waitForElementToBeRemoved(() => screen.getByTestId('loading-indicator'));
// rule.edit -> issue-alert.edit
expect(screen.getByText('issue-alert.edit')).toBeInTheDocument();
expect(screen.getByText('edited issue alert rule "New issue"')).toBeInTheDocument();
// alertrule.edit -> metric-alert.edit
expect(screen.getByText('metric-alert.edit')).toBeInTheDocument();
expect(
screen.getByText('edited metric alert rule "Failure rate too high"')
).toBeInTheDocument();
});
});