Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: archived features will be included in onboarding #8350

Merged
merged 1 commit into from
Oct 3, 2024
Merged
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
27 changes: 26 additions & 1 deletion src/lib/features/onboarding/onboarding-read-model.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ afterAll(async () => {
}
});

beforeEach(async () => {});
beforeEach(async () => {
await featureToggleStore.deleteAll();
});

test('can get instance onboarding durations', async () => {
const initialResult =
Expand Down Expand Up @@ -153,3 +155,26 @@ test('can get project onboarding status', async () => {
status: 'onboarded',
});
});

test('archived feature counts as onboarded', async () => {
await featureToggleStore.create('default', {
name: 'my-flag',
createdByUserId: SYSTEM_USER.id,
});

await lastSeenStore.setLastSeen([
{
environment: 'default',
featureName: 'my-flag',
},
]);

await featureToggleStore.archive('my-flag');

const onboardedResult =
await onboardingReadModel.getOnboardingStatusForProject('default');

expect(onboardedResult).toMatchObject({
status: 'onboarded',
});
});
1 change: 0 additions & 1 deletion src/lib/features/onboarding/onboarding-read-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ export class OnboardingReadModel implements IOnboardingReadModel {
const feature = await this.db('features')
.select('name')
.where('project', projectId)
.where('archived_at', null)
.first();

if (!feature) {
Expand Down
Loading